public static DataTable LogonUser(string userName,string password)
{
SqlConnection cn = null;
try
{
cn = new SqlConnection(ConfigurationSettings.AppSettings["cn"]);
cn.Open();
userName = userName.Replace("'","''");
password = password.Replace("'","''");
SqlDataAdapter da = new SqlDataAdapter("SELECT KullaniciAdi, Sifre, KullaniciId, Adi_SoyAdi, Unvan, Email, Aciklama, DilId, CreDate, ModDate, IsOnay, IsAktif, ModUser, CreUser FROM tGuvKullanici where KullaniciAdi='"+ userName + "' and Sifre='"+ password + "'",cn);
System.Data.DataSet ds = new DataSet();
da.Fill(ds);
SqlCommandBuilder builder = new SqlCommandBuilder(da);
builder.RefreshSchema();
return ds.Tables[0];
}
catch(Exception ex)
{
return new DataTable();
}
finally
{
if (cn!=null)
{
if (cn.State != ConnectionState.Closed)
cn.Close();
}
}
}