2016-01-06 50 views
-1
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"); 
} 
+1

这应该是一个问题吗? –

+0

顺便说一句,非常感谢您的密码:-) –

+1

您的列类型是'nchar','nvarchar'或'ntext'。其次,代码文件具有必要的编码,以表示unicode中的常量。 – affan

回答

2

首先确保你的WORD_LIST列是以下类型之一

  1. 的nchar
  2. nvarchar的
  3. NTEXT

您必须先所有Unicode字符串与prefix N在处理SQL Server中的Unicode字符串常量时

SELECT * FROM stop_word_list WHERE word_list = N'کو' 

希望有所帮助。