asp.net - Gridview with SQL data source is removing white spaces -


i have gridview connected database through sql data source. bound follow code:

    firstview = "select id, dc, dd, cym, cb, st sch_schemaname.tablename ci = " & txtboxvalue.text & " , st = 'whatever' , d = 0"   sqldatasource1.selectcommand = firstview         gridview1.databind() 

there no problem connecting database. inside database, 1 of column contains whitespace. make long story short, dd column short sentence contains more 1 space between words. e.g. "this_is____a_sentence_stored___in_the_____dd_column" each underscore space in example.

when databind, spaces in between words reduced 1 space. do, however, need keep exact amount of spaces between each word when data bound in gridview. @ moment, showing in gridview "this_is_a_sentence_stored_in_the_dd_column" want keep amount of spaces rather have them automatically cut down.

can help?

i able fix doing following on rowdatabound event gridview.

e.row.cells(4).text = e.row.cells(4).text.replace(" ", " ") 

the database retrieving correct value, spaces being parsed/encoded. jpw's links helped me line of code.

thanks


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -