using (SqlConnection myDatabaseConnection = new SqlConnection(myConnectionString.ConnectionString))
{
myDatabaseConnection.Open();
using (SqlCommand mySqlCommand1 = new SqlCommand("Select * from Emp where Fname = @Fname", myDatabaseConnection))
{
mySqlCommand1.Parameters.AddWithValue("@FName", NametextBox.Text);
SqlDataReader DR1 = mySqlCommand1.ExecuteReader();
if (DR1.Read())
{
MessagabeBox.Show("TEST");
}
}
}
例如,我Smith
在数据库中有一个 Fname,然后我输入Smith
NametextBox,messageBox 将显示。但是当我输入smith
or时SMITH
,它仍然会显示。我将如何使读者区分大小写?