Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi all... this is my 1st post and i have a problem.... im using Mysql with VB.net

 

i have a table in mysql and i can receive all data from that table into a datagrid and display it... but i would like to use each row in the datagrid...

 

ie:

 

for each row in datagrid1
Query()

 

but i am unsure how to do this... this is how im filling a Datatable...

 

Public Sub connectionmysql()
       Dim conn As MySqlConnection
       conn = New MySqlConnection
       conn.ConnectionString = "Database=" + info.DB + ";" & _
                  "SERVER=" + info.server + ";" & _
                  "UId=" + info.Uid + "; Password= " + info.pass + ";"
       Dim commandtext As String
       Dim adapter As MySqlDataAdapter
       Dim table As DataTable

       ds = New DataSet()
       commandtext = "select ip from ips;"
       Try

           adapter = New MySqlDataAdapter(commandtext, conn)
           table = New DataTable
           adapter.Fill(table)

           DataGrid1.DataSource = table
           
       Catch ex As Exception
           MsgBox(ex.ToString)

       End Try

   End Sub

 

so how could i use each ip from the datatable or datagrid1 and run my Query() function on it??? i can do this from a txt file stored on a users pc but then i cannot make it user friendly being as i cant update there txtfile and mysql is just a better way of storing,updating and managing the data i need!!!

 

thanks for your time reaidng

 

Kev

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...