SqlConnection dışardan bağlanti "diye çağırıyorum." dipnot.foruma yapıştırıken editlemedim ondan böyle oldu.
bu benim bool komutum
Alıntı
public bool ControlData()
{
string Str3 = "select CustomerTelephone from Customers where CustomerTelephone=@CustomerTelephone";
SqlCommand kontrol = new SqlCommand(Str3, baglanti);
kontrol.Parameters.AddWithValue("@CustomerTelephon e", "@CustomerTelephone");
if (baglanti.State == ConnectionState.Closed) baglanti.Open();
SqlDataReader oku1 = kontrol.ExecuteReader();
int x = 0;
while (oku1.Read() == true)
{
x++;
if (x > 1)
{
MessageBox.Show("Test");
oku1.Close();
baglanti.Close();
return true;
}
else
{
return false;
}
}
return true;
}