I have these code and when I make filter its show me data in my textbox (only character one. Not numeric one). How can I resolv it please?
string connectionString = @"Data Source=localhost\sqlexpress;Initial Catalog=master;Integrated Security=True";
SqlConnection sqlCon = new SqlConnection(connectionString);
sqlCon.Open();
string commandString = "select first_name, code from company where code='" + codesearch.Text + "'";
SqlCommand sqlCmd = new SqlCommand(commandString, sqlCon);
SqlDataReader read = sqlCmd.ExecuteReader();
while (read.Read())
{
showfirstname.Text = read["first_name"].ToString();// Here it's right
showcode.Text = read["code"].ToString();// The problem it's here
}
sqlCon.Close();
}