12
Answers

Sql instruction doesnt obey...

Israel

Israel

8y
489
1
Hi!
 
I am writing sql code to search the number up or less than "x" (dsiplaying on my datagrid). But its doent work. For instance, show me all number up than 2 or less using a textbox. See my codes please:
 
conn.Open();
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from Cliente where [age] ? ?"; // Its here
var param1 = new OleDbParameter("@idade", OleDbType.Numeric); 
param3.Value = txtAge.Text;
cmd.Parameters.Add(param1);
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(dt);
conn.Close();
dvgCons.DataSource = dt;
 
Answers (12)