在hindi / gujarati中选择查询搜索数据 [英] select query search data in hindi/gujarati

查看:54
本文介绍了在hindi / gujarati中选择查询搜索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那里,





hi there,


da = new SqlDataAdapter("SELECT * FROM QuestionBank where std='" + DropDownList1.SelectedItem.Text + "' and subject='" + DropDownList2.SelectedItem.Text + "' and chapter='" + Textbox1.Text + "'", cn);





in textbox1.text它将是数据在古吉拉特语或印地语。我无法搜索数据。



i使用nvarchar作为章节专栏。





谢谢。



in textbox1.text it would be data in gujarati or hindi. i can't search data.

i used nvarchar for chapter column.


Thanks.

推荐答案

不,这不是印地语。你应该明白,印地语不是脚本(不是写系统,不是字母),它是一种语言。字母表是Devanāgarī,देवनागरी。它以前用于古吉拉特语,但目前使用的是单独的古吉拉特语(ગુજરાતીગુજરાતીGujǎrātīLipi)。



请参阅:

< a href =https://en.wikipedia.org/wiki/Devanagari> https://en.wikipedia.org/wiki/Devanagari [ ^ ],

https://en.wikipedia.org/wiki/Gujarati_language#Writing_system [ ^ ],

https://en.wikipedia .org / wiki / Gujarati_alphabet [ ^ ]。



您只需要使用Unicode数据类型。我不知道你错过了什么。您可能无法通过多种不同的原因搜索某些内容。

至于您的查询,您的方法从一开始就是错误的。通过串联从UI获取的字符串组成的查询。不仅重复的字符串连接是低效的(因为字符串是不可变的;我是否必须解释为什么它会使重复连接变坏?),但是有更重要的问题:它打开了通向良好的大门已知的漏洞称为 SQL注入



这是它的工作原理: http://xkcd.com/327



你明白了吗?从控件中获取的字符串可以是任何东西,包括......一段SQL代码。



怎么办?只需阅读有关此问题和主要补救措施:参数化语句 http://en.wikipedia.org/ wiki / SQL_injection



使用ADO.NET,使用:http://msdn.microsoft.com/en-us/library/ff648339.aspx



请参阅我过去的答案有更多细节:

在com.ExecuteNonQuery中更新EROR( );

嗨姓名不显示?



现在,请仔细聆听。我从未在印度,也不会说任何语言。你来自印度。但是我非常尊重伟大的印度文化以及其他文化,足以避免将语言与书写系统混为一谈,并且懒得不去阅读所涉及的文化。你是一个来自印度的软件开发人员,你怎么会这么无知或懒惰而不知道这些基本的文化事物呢?你不在。我无法解开这个谜团。这太糟糕而且难过......



-SA
No, it's not Hindi. You should understand that Hindi is not script (not writing system, not alphabet), it is a language. The alphabet is Devanāgarī, देवनागरी. It was formerly used for Gujarati, but presently a separate Gujarati script (ગુજરાતી લિપિ Gujǎrātī Lipi) is used.

Please see:
https://en.wikipedia.org/wiki/Devanagari[^],
https://en.wikipedia.org/wiki/Gujarati_language#Writing_system[^],
https://en.wikipedia.org/wiki/Gujarati_alphabet[^].

You just need to use Unicode data types. I have no idea what you are missing. You could fail to search for something by a number of different reasons.
As to your query, your approach is wrong from the very beginning. The query composed by concatenation with strings taken from UI. Not only repeated string concatenation is inefficient (because strings are immutable; do I have to explain why it makes repeated concatenation bad?), but there is way more important issue: it opens the doors to a well-known exploit called SQL injection.

This is how it works: http://xkcd.com/327.

Are you getting the idea? The string taken from a control can be anything, including… a fragment of SQL code.

What to do? Just read about this problem and the main remedy: parametrized statements: http://en.wikipedia.org/wiki/SQL_injection.

With ADO.NET, use this: http://msdn.microsoft.com/en-us/library/ff648339.aspx.

Please see my past answers for some more detail:
EROR IN UPATE in com.ExecuteNonQuery();,
hi name is not displaying in name?.

Now, please listen carefully. I have never being in India and cannot speak any of the language. You are from India. But I have a lot of respect to great Indian culture, as well as other cultures, enough to avoid being ignorant so much to mix up languages with writing systems and to be so lazy not to read about the cultures involved. How come you, a software developer from India, can be so ignorant or lazy to have no clue of such basic cultural things? You are not along. I cannot solve this mystery. This is too bad and sad…

—SA


这篇关于在hindi / gujarati中选择查询搜索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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