المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Bug with between sql command



C# Programming
05-14-2009, 02:21 PM
I've used sql command here is my code
string CommandText = "select * from par where Time between '" + textBox7.Text + "%' and '" + textBox13.Text + "%' and Date like '" + textBox6.Text + "%' and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%'and Duration >= " + textBox10.Text + " ;";
DB = new SQLiteDataAdapter(CommandText, sql_con);//?????????????
DS.Reset();
DB.Fill(DS);//??? ???????????????? ????????
DT = DS.Tables[0];
dataGridView1.DataSource = DT;
int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
textBox12.Text = rowCount.ToString();
sql_con.Close();

It has problem that if I haven't insert value to Time it will not show anything but
if I take the value to it I can run the search and It'll take the value to mydatagrid

http://www.barakasoft.com/script/Forums/Images/smiley_confused.gif