sql server - Rich text box text with formatting does not save in SQL for VB.NET -


i working on vb form project in have rtb (rich text box), want save formatted text save sql math type character.it saves out formatting , miss math character? here code

        dim sname integer = integer.parse(txt1.text)         dim sfname integer = 2         dim scnic string = rtb.selectedtext          query &= "insert tencmpc1 (qnumber,topic,umcq)"           query &= "values (@qnumber, @topic,@umcq )"           using conn new sqlconnection(strconn)             using comm new sqlcommand()                 comm                     .connection = conn                     .commandtype = commandtype.text                     .commandtext = query                     .parameters.addwithvalue("@qnumber", sname)                     .parameters.addwithvalue("@topic", sfname)                     .parameters.addwithvalue("@umcq", scnic)              conn.open()                      comm.executenonquery()                      txt10.text = "question saved "                 end                end using 

here below code formated rtb

if fontdlg.showdialog() <> windows.forms.dialogresult.cancel         rtb.selectionfont = fontdlg.font 

image below show result while in rtb @ inserting time , in sql out when out sql out formating? enter image description here

i using nvarchar datatype of umcq table of sql.

also math character not supported. enter image description here

the issue seems saving rtb.selectedtext database rather rtb.selectedrtf. selectedtext property ever returns plain text. selectedrtf property 1 returns value containing of rich-text formatting.


Comments

Popular posts from this blog

python - argument must be rect style object - Pygame -

c++ - Qt setGeometry: Unable to set geometry -

How to do feature selection and reduction on a LIBSVM file in Spark using Python? -