merhaba







id ye göre veri çekebiliyorum. ad a göre veriyi bir türlü çekemedim. ad a göre nasıl veri çekebilirim?

OleDbConnection connect;
OleDbDataAdapter dataAdapter1;
DataTable DataTable1;

OleDbConnection connecting = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12. 0;Data Source=DB.accdb");
OleDbCommand Komut;




formload

connect = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0 ;data source=TalebeHizmetleriPrg.accdb");
connect.Open();

dataAdapter1 = new OleDbDataAdapter();
DataTable1 = new DataTable();
dataAdapter1.SelectCommand = connect.CreateCommand();
dataAdapter1.SelectCommand.CommandText = "Select * from Giris\n";
dataAdapter1.SelectCommand.CommandText += "where id=0";
DataTable1.Clear();
dataAdapter1.Fill(DataTable1);
try
{
if (connecting.State == ConnectionState.Closed)
{
connecting.Open();
BilgiAl();
}
}
catch (Exception ex)
{
MessageBox.Show("Hata Oluştu" + ex.Message);
}


clickevent

try
{
if (textBoxKullaniciAdi.Text != string.Empty)
{
if (textBoxKullaniciAdi.Text.Trim() == "") return;
dataAdapter1.SelectCommand = connecting.CreateCommand();
dataAdapter1.SelectCommand.CommandText = "Select * from Giris\n";
dataAdapter1.SelectCommand.CommandText += "where id=" + textBoxKullaniciAdi.Text.Trim();
DataTable1.Clear();
dataAdapter1.Fill(DataTable1);
if (DataTable1.Rows.Count > 0)
{
DataRow veri = DataTable1.Rows[0];
label5.Text = veri[1].ToString();


}
else
MessageBox.Show("Veri tabanımızda böyle bir kayda rastlanmadı...", "Böyle Bir Kayıt Yok", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
MessageBox.Show("hata mesajı!", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}



---------------------------------------------------


private void BilgiAl()
{
OleDbDataAdapter da = new OleDbDataAdapter("SELECT*FROM Giris", connecting);
DataSet ds = new DataSet();
da.Fill(ds, "Goruntule");
dataGridView1.DataSource = ds.Tables["Goruntule"];

}
private void aramaYap(string kriter, string alan)
{
string sorgu = "SELECT * FROM Giris WHERE ";

if (textBoxKullaniciAdi.Text != "")
{
sorgu += alan + " like '" + textBoxKullaniciAdi.Text + "%'";
guncelleme(sorgu);
}

}

void guncelleme(string sorgu)
{
OleDbDataAdapter da = new OleDbDataAdapter(sorgu, connecting);
DataSet ds = new DataSet();
da.Fill(ds, "GUNCELLEMEYAP");
dataGridView1.DataSource = ds.Tables["GUNCELLEMEYAP"];
}