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

مشاهدة النسخة كاملة : Searching within datagridview



C# Programming
03-30-2009, 08:32 PM
Hey everyone,

I've got a datagridview linked to an access database with a seach function. It's working well, but with one problem. It only displays the row(s) when you search for the complete User Name. It would be a big time saver if the search would locate any row(s) which contains the txtSearchID, so you would not need to type out the whole user name every time.

At the moment I am using:
Command.CommandText = "SELECT * FROM Users WHERE [User ID] = '" + txtSearchID.Text + "'";
OleDbDataAdapter Adapter = new OleDbDataAdapter(Command);
Adapter.Fill(ds);


I'm sure theres a simple answer, just can't quite figure it out.

Any help greatly appreciated

Martin