I m new to C#, so please ignore if I use wrong terms.
I m working on a single form application in VS2010, with sql database. I have successfully inserted the data in to database table.
but search is the problem, when ever i try to perform the search the datagridview control displays all the data present in the database.
this is what I m doing...
Expand|Select|Wrap|Line Numbers
- private void btnSearchName_Click(object sender, EventArgs e)
- {
- try
- {
- sqlcon.Open();
- sqlcmd = new SqlCommand("select * from tblContacts where NAME = ('"+ txtSearchName.Text +"')") ;
- sqlcon.Close();
thanks