adspace
How to Insert a TextBox value in to Sql database using
VB.Net coding?
Answer Posted / anusuya
dim con as new sqlconnection
dim da as sqldataadapter
dim ds as new dataset
dim str as string
con.connectionstring="server=localhost;uid=sa;pwd=;database=
Hospital"
con.open
str="insert into patient values('" & lblid.Text & "','" &
txtname.Text & "','" & rtxtaddress.Text & "','" &
DateTimePicker1.Text & "','" & cmbgender.Text & "','" &
txtphone.Text & "','" & txtemcon.Text & "','" &
txtdoreg.Text &"')"
da=new sqldataadpter(str,con)
da.fill(ds,"patient")
msgbox "New Row inserted"
con.close
| Is This Answer Correct ? | 30 Yes | 24 No |
Post New Answer View All Answers
What is early binding?
Explain how can we remove handlers at run time?
What is the use of assembly?
How to retrieve images in sql server database through vb.net?
What are the features of c# which are not present in vb.net?
What is option strict?
Explain the difference between system.string and system.stringbuilder classes?
Explain an assembly?
How to send xml file on server using http protocol?
How to store images in sql server database through vb.net?
Explain the difference between datatable and dataset?
How can I extract the formated word(bold,italic,underline,font,color etc) from the msword file.?