I founded this kind of a code for a saving table to sql database.
http://www.dbazine.com/cook5.html
what are "region" and "territories"? am i supposed to fill thoes with my table names or something? Or is there an easier way to update database?
http://www.dbazine.com/cook5.html
Code:
yhteys is my connection string...
Dim sqlConn As SqlConnection(yhteys)
Dim sqlRegion As SqlDataAdapter = _
New SqlDataAdapter("select * from region", sqlConn)
Dim sqlTerritories As SqlDataAdapter = _
New SqlDataAdapter("select * from territories", sqlConn)
Dim regionCommandBuilder As SqlCommandBuilder = _
New SqlCommandBuilder(sqlRegion)
Dim territoriesCommandBuilder As SqlCommandBuilder = _
New SqlCommandBuilder(sqlTerritories)
sqlRegion.Update(dsNorthwind, "Region")
sqlTerritories.Update(dsNorthwind, "Territories")
sqlConn.Close()
sqlConn.Dispose()