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!!!
:rolleyes:
Any help is appreciated!
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. :bigyello: