sql server - compare string from database and from c# -


if have query

var query = c in ds.prices select c; datagridcontrol1.autocreatecolumns = true; datagridcontrol1.itemssource = query; 

datagrid show data table(`ds = new dataset()). when add condition

var query = c in ds.prices c.idsticker.equals("goog") select c; datagridcontrol1.autocreatecolumns = true; datagridcontrol1.itemssource = query; 

datagrid empty. value goog exists in table(idsticker varchar(10) in sql server). when compare int values(for example condition where c.prices > 660) works normal.

what wrong?

all can think of apply trim() it, , possibly toupper() see if 1 or both of makes difference.

var query = c in ds.prices c.idsticker.trim().toupper().equals("goog") select c; datagridcontrol1.autocreatecolumns = true; datagridcontrol1.itemssource = query; 

beyond that, try executing same query using sql against database.

select * prices idsticker = 'goog' 

Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -