具有相同单词但不区分大小写的AutoComplete TextBox不显示第二个选项 [英] AutoComplete TextBox with same words but case different does not show the second option

查看:99
本文介绍了具有相同单词但不区分大小写的AutoComplete TextBox不显示第二个选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道你如何能够显示不同情况但是相同的单词。



在数据库中有人输入了小写字母(在该项目中)所有的话都是)

Normaly这个词以大写字母开头。



建议现在总是小写的。



例如:



楼梯

楼梯

(两者都在字符串数组)





文本框只会建议楼梯。楼梯不存在作为建议。



谢谢

Does someone knows how you can make words shown which are case different, but the same.

In a Database someone has entered the word lowercase (in that project all words are)
Normaly the word starts with an uppercase.

The suggestion is now always lowercase.

For example:

Staircase
staircase
(both are in the string array)


The textbox will only suggest staircase. Staircase does not exist as suggestion.

Thanks

推荐答案

这不是最好的解决方案,但是在我使用的SQL查询:



从表格顺序中选择唯一的较低(fieldname),fieldname by lower(fieldname)asc



在数据集中使用foreach循环我用前一个检查第一个值



如果相同:我添加到第二个值''² ''



第二个值被添加到数组列表中。



如果在texbox中选择TextChanged选项我用零替换最后一部分。 。 。



string sDubbel =;

string [] sAReturn = new string [dsRes.Tables [0] .Rows .Count];

foreach(DataRow dr in dsRes.Tables [0] .Rows)

{

if(sDubbel == dr [ 1] .ToString()。修剪()。ToUpper())

dr [1] = dr [1] .ToString()。修剪()+²;

else

sDubbel = dr [1] .ToString()。Trim()。ToUpper();



sAReturn [ii ] = dr [1] .ToString()。Trim();

ii ++;

}

dsRes.Dispose();

返回sAReturn;

It is not the best solutions, but on the sql query i use:

select unique lower(fieldname),fieldname from table order by lower(fieldname) asc

with a foreach loop in the dataset i check the first value with the previous one

if the same: i add to the second value '' ²''

the second value is added to the array list.

If choosen in the texbox on the TextChanged option I replace the last part with nothing . . .

string sDubbel = "";
string[] sAReturn = new string[dsRes.Tables[0].Rows.Count];
foreach (DataRow dr in dsRes.Tables[0].Rows)
{
if (sDubbel == dr[1].ToString().Trim().ToUpper())
dr[1] = dr[1].ToString().Trim() + " ²";
else
sDubbel = dr[1].ToString().Trim().ToUpper();

sAReturn[ii] = dr[1].ToString().Trim();
ii++;
}
dsRes.Dispose();
return sAReturn;


您好b $ b

抱歉,我不清楚你的问题。你能详细解释一下。
Hi
sorry i am not clear with your question. can you explain in details.


这篇关于具有相同单词但不区分大小写的AutoComplete TextBox不显示第二个选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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