Israel

Israel

  • 701
  • 1.3k
  • 217.2k

Sql instruction doesnt obey...

Mar 24 2016 9:08 AM
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)