/ / Włóż Datatable do bazy danych mysql w asp.net - asp.net, mysql, datatable

Włóż Datatable do bazy danych mysql w asp.net - asp.net, mysql, datatable

Czy istnieje sposób na wstawienie dynamicznie generowanej bazy danych do bazy danych mysql w asp.net?

Odpowiedzi:

2 dla odpowiedzi № 1
Sub OutputQty(ByVal dt As DataTable, ByVal AdID As Integer)
Dim sql As String = ""
Dim con As New SqlConnection(Utilities.DELcon)
Dim cmd As New SqlCommand(sql, con)
con.Open()
For Each row In dt.Rows
sql = "INSERT INTO DMQtyOutput (AdID, CompanyID, StoreNumber, DemandQty) VALUES ("" & row("AdID") & "","" & row("CompanyID") & "","" & row("StoreNumber") & "","" & row("DemandQty") & "")"
cmd.CommandText = sql
cmd.ExecuteNonQuery()
Next
con.Close()
End Sub