SqlConnection objConnection = new SqlConnection(_ConnectionString);
objConnection.Open();
SqlCommand objCommand = new SqlCommand(
   "SELECT * FROM User WHERE Name = @Name AND Password = @Password",
   objConnection);
objCommand.Parameters.Add("@Name",NameTextBox.Text);
objCommand.Parameters.Add("@Password", PasswordTextBox.Text);
SqlDataReader objReader = objCommand.ExecuteReader();
if (objReader.Read())
{
//.....
}

相关文章:

  • 2022-12-23
  • 2021-05-17
  • 2021-09-16
  • 2021-05-15
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2021-06-14
  • 2021-11-24
  • 2021-06-08
  • 2022-12-23
相关资源
相似解决方案