我在嘗試使用此查詢來比較我的密碼的值,但是當我嘗試使用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。 –