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
Explain about rapid application development tool?
What is enumerator?
What are jagged arrarys ?
What is a literal control?
Write program in VB.Net with SQL Server and Crystal Reports to develop a small windows application to add,edit,save, search and print Employee Information and send sourcecode as zip file. empcode : .............. empname : .............. dateofjoin : dd/mm/yyyy dateofbirth : dd/mm/yyyy TableName: EmpMaster EmpCode EmpName DOB DOJ TableName: EmpDocs EmpCode DocNo DocName ExpDate
What is early binding?
Explain internal keyword in .net framework?
What is the role of new keyword?
What is a static class?
What is the difference between manifest and metadata?
What are the different variables in vb.net?
Why is the xml infoset specification different from the xml dom?
Explain the use of serialization and deserialization?
What is the difference between compiler and interpreter?
Explain the use of new keyword?