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
i have two class that contain's two methods as same name in derived class i have to call these two methods what will happen at run time ?
source code for how to login a vb.net application ?
What is sorting in vb?
what is interface and when it is used?
Explain the difference between dispose and finalize()?
What are jagged arrays ?
Can you please explain the difference between dispose and finalize()?
Name some of the keywords used in vb.net?
What is the difference between Namespace and Assembly?
Explain public assembly?
Write a VB.Net console program to check whether a number is perfect or not.
thak you Mr Govind for replying to my question. My next question is that how to retrieve image stored in an SQL server table and assign it to any image control or picture control using VB.net
Explain the difference between import system.data.sqlclient and system.data.oledb?
What is the use of errorprovider control?
How to store images in sql server database through vb.net?