I know I've asked a similar question before but I still can't get this working.
I'm using C# in VS2010
What I'm doing is creating an application that takes user entered words in textbox1 clicks a button and all words with "*" in front of them print in textbox2
I'm using a SQL Server database to do this because I want the "*" words to be stored in the database so I can later add a counter to show how many times that word has been entered.
For example:
- User enters
the cat is *brownintextbox1, presses a button, then*brownappears intextbox2
My code for SQL Server is this:
SqlConnection con = new SqlConnection(@"Server=.\SQLEXPRESS;Database=StoreList;Integrated Security=sspi");
con.Open();
String queryStr = "SELECT item FROM StoreList WHERE item LIKE '*%'";
SqlCommand com = new SqlCommand(queryStr, con);
SqlDataReader sdr = com.ExecuteReader();
while (sdr.Read())
{
this.textbox2.Text = sdr.GetValue(0).ToString();
}
sdr.Close();
What I need help with is how to further that code to get the app working. So I don't know how to make it get the word from textbox1.
Any help guys?