Advertisement

04.24.2008 at 06:07AM PDT, ID: 23350082
[x]
Attachment Details

Adding data from sql database to textboxes and editing the data

Asked by Cannibal_Jack in .NET, Microsoft Visual Basic.Net, ADO.Net Class Library

Tags: VB.net

Hi, I wish to pull data from an sql table that matches an ID number entered by the user and then that information to be inserted intp the relevant textboxes. But I'm not sure how to do that. Here's what I have so far...

 Dim Con As New SqlClient.SqlConnection(ConnectionString)
Dim strSQL As String = "SELECT * FROM PeopleTBL where Patient_Number = '" & ss & "' (Name, Age, Address) Values (@Name,@Age,@Address)"
        Dim da As New SqlClient.SqlDataAdapter(strSQL, Con)
        Dim ds As New DataSet
        da.Fill(ds, "People_Table")
Textbox1.Text = "@Name"
Textbox1.Text = "@Age"
Textbox1.Text = "@Address"

I dont think thats correct, could somebody help correct it, so that it works correctly?Start Free Trial
[+][-]04.24.2008 at 06:23AM PDT, ID: 21430504

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, Microsoft Visual Basic.Net, ADO.Net Class Library
Tags: VB.net
Sign Up Now!
Solution Provided By: naspinski
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.24.2008 at 06:24AM PDT, ID: 21430513

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628