我需要国际化我的数据集 [英] I need to internationalisation my Dataset

查看:71
本文介绍了我需要国际化我的数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用C#创建一个DataSet和DataTable,然后为一个SQL Server DB生成一个报表(我使用Report Viewer).当我的值是英语时,我需要在数据库中搜索值"字段,就像测试"一样,每件事都可以,但是当我的值是Arabic \ Persian \ Farsi时,报表查看器不会显示任何内容.

我的查询是这样的:

I make a DataSet and DataTable in C# and then make a report for a SQL Server DB (I Use Report Viewer). I need to search Value field in DataBase when my Value is English Like "test" every thing is be OK, but when my value is Arabic\Persian\Farsi the report viewer dosen''t show me anything.

My query is this:

SELECT DetailsProducts.DarSad, Materials.Material, Products.Product
FROM DetailsProducts INNER JOIN
    Materials ON DetailsProducts.MaterialID = Materials.ID INNER JOIN
    Products ON DetailsProducts.ProductID = Products.ProductID
WHERE (Products.Product = @Product)


当我需要一个值时,可以使用以下查询:


When I need one value I can use this query:

SELECT DetailsProducts.DarSad, Materials.Material, Products.Product
FROM DetailsProducts INNER JOIN
    Materials ON DetailsProducts.MaterialID = Materials.ID INNER JOIN
    Products ON DetailsProducts.ProductID = Products.ProductID
WHERE (Products.Product =N'بطری') //(Bottle = بطری)


可以,但是当我使用参数时,此"N" exp"不起作用.我该如何解决?


It is OK, but this " N''exp'' " dose not work when I Use Parameters. How can I fix this?

推荐答案

我刚刚进行了测试并为我工作

Sp ...

I just did a test and works for me

Sp...

CREATE PROCEDURE spSelect @name nvarchar(40)
AS
BEGIN
    select *
    from employees
    where name  =@name

END



正在呼叫....



Calling....

either spSelect N''بطری'' 
or EXECUTE spSelect @name = N''بطری''




您可能必须为您的SQLcommand对象设置以下内容




You may have to set the following for you SQLcommand Object

parameter.SqlDbType = SqlDbType.NVarChar;


这篇关于我需要国际化我的数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆