I new to C#, and trying to make a winform app, i am having problem to search a Database depending upon the text entered in a textbox.
I have added the gridview, when adding a new query, what should be the WHERE clause like to be able to use data from Winform controls?
Also do i need to change the fill table call ?
And is there any Good books that may cover a good amount of similar topic,i.e,working with databases in c# winforms?
Thank you all, in advance..
You should look into making a stored procedure for your query and then you supply the value from your textbox.Text field into your stored procedure.
This other question might help you with the C# syntax:
How to execute a stored procedure within C# program
And assuming you’re trying out SQL Server Express, this should help you setup the query as a stored procedure:
http://msdn.microsoft.com/en-us/library/ms345415.aspx
Otherwise if you’re going for basic SQL in the winForm, you likely want to run the query based on the user pressing a button rather than the “TextChanged” event on the TextBox: