Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Name some of the features present in vb 2005?

917


What is the difference between convert.tostring and i.tostring method?

934


Why do you need Lock in Visual Basic?

1058


What is normal jit?

1016


Is vb net a scripting language?

920


Before in my vb app I would just load the icons from dll. How can I load the icons provided by .net dynamically?

929


Explain jagged array in vb.net?

944


What are option strict and option explicit?

1320


Did vb6 support multi-threading ?

912


Explain the use of console application?

925


What is private assembly?

897


How to execute VB.NET PROJECTS,VB6.0 PROJECTS AND write their test cases.Need Reply Urgently

2459


Write a program to find all text files in a logical drive and return the count of the number of files?

2667


What is tracing?

1054


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.

3496