這是我的代碼,但它返回-1
值。 Name
字段包含一個unicode值。如何通過Unicode值作爲選擇命令的參數
using (SqlConnection conn = new SqlConnection(connStr))
{
string str = string.Format("select SrNo from Jat where [email protected]");
SqlCommand dCmd = new SqlCommand(str, conn);
try
{
dCmd.Parameters.AddWithValue("@Name","N" +Name);
int i= dCmd.ExecuteNonQuery();
return i;
}
catch
{
throw;
}
}
顯示方式:** HTTP://stackoverflow.com/questions/7548371/unicode-sql-query-w-parameter-instead -n-前綴** –