Results 1 to 2 of 2

Thread: pulling data from dataSet into string?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2004
    Location
    STL
    Posts
    182

    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!

  2. #2
    Hyperactive Member fret's Avatar
    Join Date
    Sep 2004
    Posts
    472

    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
  •  



Click Here to Expand Forum to Full Width