dataTable to Database

  • Thread starter Thread starter Bruno Alexandre
  • Start date Start date
B

Bruno Alexandre

Hi guys,

I have a dataTable with 2 columns and several rows...

How can I pass this into the Database?
How can I read row by row so I can insert it in Database, somthing like

for each dataTable.row

col1 = .column("date").toString
col2 = .column("desc").toString

sSQL = "INSERT INTO tblTable (t1, t2) VALUES ('" & col1 & "', '" & col2
& "')"

next


--



Bruno Alexandre
(Sintra, PORTUGAL)
 
Try:

For Each row As DataRow In dataTable.Rows
strDate = row("date").ToString
strDesc = row("desc").ToString
sql = ...
Next

HTH

Elton Wang
 
Back
Top