I need to get the data from the sql database and send it to a mysql database programmaticly how could I do this?
Here is what i'm currently trying
Try
con3.ConnectionString = MyConnectionString
con3.Open()
Dim cmd As New MySqlCommand _
("SELECT kjuy6_postmeta.meta_value, kjuy6_posts.ID, kjuy6_posts.post_status, kjuy6_woocommerce_order_items.order_item_name FROM kjuy6_postmeta INNER JOIN kjuy6_posts ON kjuy6_postmeta.post_id = kjuy6_posts.ID And kjuy6_postmeta.post_id = kjuy6_posts.ID, kjuy6_woocommerce_order_items WHERE kjuy6_posts.post_type = 'shop_order' AND kjuy6_postmeta.meta_key = '_paid_date' OR kjuy6_postmeta.meta_key = '_billing_phone'")
cmd.Connection = con3
'Dim reader As MySqlDataReader = cmd.ExecuteReader
Dim da As New MySqlDataAdapter(cmd)
da.Fill(ds)
Dim a = ds.Tables(0).Rows(0).Item("meta_value")
Dim b = ds.Tables(0).Rows(0).Item("meta_value")
Dim c = ds.Tables(0).Rows(0).Item("post_status")
Dim d = ds.Tables(0).Rows(0).Item("order_item_name")
If Not IsNothing(cmd) Then
con.Open()
ExecuteData("INSERT INTO BillingInfo (vchUsername, vchExpiryDate, vchOrderStatus, vchSubscriptionType, intSubscriberid) VALUES('" & a & "','" & b & "','" & c & "','" & d & "', '" & SubscriberId & "')")
End If
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
con3.Close()
con.Close()
End Try
the following is to seperate the meta values and to use the variable in the insert query as the values
Dim da As New MySqlDataAdapter(cmd)
da.Fill(ds)
Dim a = ds.Tables(0).Rows(0).Item("meta_value")
Dim b = ds.Tables(0).Rows(0).Item("meta_value")
Dim c = ds.Tables(0).Rows(0).Item("post_status")
Dim d = ds.Tables(0).Rows(0).Item("order_item_name")
the problem with this is assigning the correct meta value to a variable so that it can be inserted into the correct column