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
Can you please explain the difference between thread and process?
How to achieve Polymorphism in VB.Net?
What is the differences between dataset.clone and dataset.copy?
How a base class method is hidden?
Explain manifest?
Explain strong name in .net assembly?
Name some of the features of C# which are not present in VB.NET?
What is the diff between vb mdi form and .net mdi form?
How many languages are supported by .net?
What is the main purpose of garbage collector?
Explain option explicit?
Explain some of the exclusive features which are present in vb?
Explain the difference between value and reference types?
Which is the tool which can convert visual basic old version to .net compatibility version?
What are the advantages of vb.net and c#?