我在尝试使用此查询来比较我的密码的值,但是当我尝试使用COLLATE SQL_Latin1_General_CP1_CI_AS
时,它不起作用。区分大小写的查询比较值
请帮助我在这个问题上
错误消息
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll Additional information: IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
我的代码
OleDbConnection con = new OleDbConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["Connection"].ToString();
con.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.CommandText = "SELECT UserName, Password, ID FROM AdminLogin WHERE UserName='" + txtUserName.Text + "' AND Password='" + txtPassword.Password + "' COLLATE SQL_Latin1_General_CP1_CI_AS";
cmd.Connection = con;
OleDbDataReader rd = cmd.ExecuteReader();
如果您尝试连接mdb或accdb访问文件,那么您不使用SQL Server排序规则 –
然后我使用哪种排序规则? –
请参阅[本文](https://support.microsoft.com/en-us/help/244693/how-to-perform-a-case-sensitive-join-through-microsoft-jet?wa=wsignin1.0 )来自MS。 –