using Where clause in the Command Object in c# for Winforms
Posted on 2007-04-05
I have following function,
public Customer GetCustomer(string customerName)
string command = "select * from Customers where 'Name = customerName' ";
OleDbDataAdapter da = new OleDbDataAdapter(command,connection);
DataSet ds = new DataSet();
DataTable dt = ds.Tables;
if(dt.Rows.Count == 0)
return GetObject(dt.Rows) as Customer;
but eventhough im passing the Name as parameter and using it in my where claues its getting the only first row of the table and not the desired row.
Can any one tell me where im going wrong.