|
-
Dec 8th, 2004, 03:52 PM
#1
Thread Starter
Addicted Member
pulling data from dataSet into string?
Hey all, looking for some code examples on how to pull a record from my db table, or even run a SQL query and put the result in a variable in VB.Net so I can use it to validate, etc.
I had the code to take a value from a DS and put into a string for example, but can't find it!!!
Any help is appreciated!
-
Dec 8th, 2004, 09:02 PM
#2
Hyperactive Member
Re: pulling data from dataSet into string?
not sure though what you're talking about, but might this help.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
da.SelectCommand = New SqlCommand("select * from Student", cn)
ds.Tables.Add(New DataTable("Table1"))
da.Fill(ds.Tables(0))
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim arrRow() As DataRow
arrRow = ds.Tables(0).Select("Idno = 3")
TextBox1.Text = arrRow(0)(1).ToString
End Sub
if i misleading you sorry for that, but try to explain more details on what your trying to do.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|