Example #1
0
 public int uyeSorgula(uyeler uye)
 {
     int sonuc = -1;
     try
     {
         Fonksiyon fnk = new Fonksiyon();
         SqlConnection con = fnk.Baglan();
         SqlCommand cmd = new SqlCommand();
         cmd.Connection = con;
         cmd.CommandText = "SELECT * FROM uyeler Where kullaniciadi='" + uye.uyeisim + "' and sifre='" + uye.sifre + "'";
         cmd.CommandType = CommandType.Text;
         SqlDataReader dr = cmd.ExecuteReader();
         if(dr.Read())
         {
             sonuc = Convert.ToInt32(dr["id"].ToString());
         }
     }
     catch (Exception)
     {
         throw;
     }
     return sonuc;
 }