C#urdu写入未从数据库中读取
本文关键字:数据库 读取 C#urdu | 更新日期: 2023-09-27 18:29:13
SqlConnection con = new SqlConnection("Data Source=ALIZEE_TROTT''SQLEXPRESS;Initial Catalog=UrduStemmer;Persist Security Info=false; User ID=sa;Password=password");
SqlDataAdapter sda = new SqlDataAdapter("select * from stop_word_list where word_list='کو' ", con);
DataTable dt = new System.Data.DataTable();
sda.Fill(dt);
if (dt.Rows.Count == 1)
{
MessageBox.Show("Ok");
}
else
{
MessageBox.Show("not ok");
}
首先确保word_list的列是以下类型的之一
- nchar
- nvarchar
- ntext
在SQLServer中处理Unicode字符串常量时,必须在所有Unicode字符串前面加前缀N
SELECT * FROM stop_word_list WHERE word_list = N'کو'
希望能有所帮助。