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 the difference between system.applicationexception class and system.systemexception?
What is the difference between manifest and metadata?
What is a static variable?
Explain about visual basic?
What is globalization?
Which class allows an element to be accessed using unique key?
What is the difference between import system.data.sqlclient and system.data.oledb?
What keyword is used to accept a variable number of parameter in a method?
Observations between vb.net and vc#.net?
What are the difference between structure and class?
Which is the tool which can convert visual basic old version to .net compatibility version?
List the types of authentication?
Explain about the performance of visual basic?
Explain cts?
What is the significance of delegates. Where should they be used? What are the situations where we require them?