jeivid
چهارشنبه 10 فروردین 1390, 18:55 عصر
با سلام دوستان من مي خوام از بانك اطلاعاتي كلماتي را جستجو كنم و توي dataGridView قرار بدم ولي نميشه مي تونين بگين مشكلش كد كجاست
private void txtsearch_KeyPress(object sender, KeyPressEventArgs e)
{
DataTable dt = new DataTable();
sendmail sm = new sendmail();
if (rbother.Checked == true)
{
dt = sm.searchother(txtsearch.Text);
dataGridView1.DataSource = dt;
}
}
و اينم كد اس كيو ال ش هستش
public DataTable searchother(string other)
{
string sql = "select * from sendmail where Sother like '%N{0}%'";
sql = string.Format(sql, other);
DataTable dt = new DataTable();
db.Connect();
dt = db.Select(sql);
db.Disconnect();
return dt;
}
private void txtsearch_KeyPress(object sender, KeyPressEventArgs e)
{
DataTable dt = new DataTable();
sendmail sm = new sendmail();
if (rbother.Checked == true)
{
dt = sm.searchother(txtsearch.Text);
dataGridView1.DataSource = dt;
}
}
و اينم كد اس كيو ال ش هستش
public DataTable searchother(string other)
{
string sql = "select * from sendmail where Sother like '%N{0}%'";
sql = string.Format(sql, other);
DataTable dt = new DataTable();
db.Connect();
dt = db.Select(sql);
db.Disconnect();
return dt;
}