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
Name some of the features present in vb 2005?
What is the difference between convert.tostring and i.tostring method?
Why do you need Lock in Visual Basic?
What is normal jit?
Is vb net a scripting language?
Before in my vb app I would just load the icons from dll. How can I load the icons provided by .net dynamically?
Explain jagged array in vb.net?
What are option strict and option explicit?
Did vb6 support multi-threading ?
Explain the use of console application?
What is private assembly?
How to execute VB.NET PROJECTS,VB6.0 PROJECTS AND write their test cases.Need Reply Urgently
Write a program to find all text files in a logical drive and return the count of the number of files?
What is tracing?
Write a program that would find the nth term of a geometric progression, given the value of first term and common ratio. Any inbuilt function that the language provides for calculating exponent should not be used.