i have this code for fast search
Tmp = "";
MAK = "";
DES = "";
Cmd.CommandType = CommandType.TableDirect;
Cmd.CommandText = "Ham";
Cmd.IndexName = "B";
Cmd.SetRange(DbRangeOptions.Match , new object[] { txtMa.Text }, null);
SqlCeDataReader read = Cmd.ExecuteReader();
while (read.Read())
{
Tmp = read[2].ToString();
MAK = read[0].ToString();
DES = read[1].ToString();
}
read.Dispose();
if (Tmp == "")
{
return false;
}
else
{
txtDes.Text = DES;
return true;
}
it works excellent – but the problem is
when i search ABC and when i search abc i get the same resault
how to separate between them ?
thank’s in advance
Case-sensitivity of SQL searches would be a setting of your database.
In particular for SQL Compact Edition you need to make sure you are using a 3.5 SP1+ database with collation enabled at creation time, or otherwise apply these changes:
Source: http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/649f10a8-6880-46c4-82db-fb52b29614b9
I would recommend reading that source as it yields important information such as how case-sensitivity breaks backwards compatibility.