Click here to Skip to main content
16,011,905 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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
Posted
Comments
ZurdoDev 11-Mar-13 11:08am    
Have you traced the code to see what it is doing?

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;
 
Share this answer
 
Hi
sorry i am not clear with your question. can you explain in details.
 
Share this answer
 
Comments
Richard C Bishop 11-Mar-13 12:29pm    
You will want to use the "Have a Question or Comment?" link to ask questions or post comments. You posted this comment as a solution.
Piet Pelle 11-Mar-13 13:53pm    
try a textbox with say three lines in AutoCompleteCustomSource
staircase
Staircase
Stair
AutoCompleteMode = Suggest
AutoCompletSource = CustomSource

if you type a 's'in the textbox it only shows one staircase (the wrong one) and stair
I believe that the textbox considers them the same . . .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900