c# - How do I wrap a text in SQL Server database? -


as shown in photo, cell in datagridview contains 2 lines , when insert database doesn't wrap. checked wrap option in tools --> options --> test editor --> language --> word wrap. word wrap still not working. can see wrapped line in datagridview becomes 1 line in database. idea in how can wrap line?

i used code insert data datagridview sql server database:

 private void button9_click(object sender, eventargs e)      {         sqlconnection cn = new sqlconnection("data source=pcn-tosh;initial    catalog=mydb;integrated security=true");              cn.open();             sqlcommand cm = new sqlcommand("insert customer(qty, des, price) values ('" + datagridview1.rows[0].cells[0].value + "', '" + datagridview1.rows[0].cells[1].value + "','" + datagridview1.rows[0].cells[2].value + "')");             cm.connection = cn;             cm.executenonquery();             cn.close();         } 

photo

it doesn't matter how value rendered sql server mgmt studio's (smms's) result set viewer. program has pretty basic abilities display multi line text.

the real question whether value renders correctly in application program after round trip data base. if does, well.

if doesn't, should try figure out whether information being altered on way database, or way back.

i have succeeded @ using copy copy text smms, , paste simple text editor. drag cursor count spaces.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -