Adding new records to an SQL database via vb.net
Posted on 2004-08-26
I have read in a very large text file and have extrapolated the data that I need using the Mid command. I know need to write this data to multiple tables in my database. I have studied how to do it using ADO.net but I am wandering if there is a single SQL update command that I can use without having to use the ADO structures and commands. Here is how I believe I will have to do it using ADO. Please show be a better way.
Dim myAdapter As New SqlDataAdapter
myConnString = "Data Source=localhost;Initial Catalog=NewTaks;User Id=sa;"
Dim myConnection As New SqlConnection(myConnString)
'Dim studentInfo table as DataTable = New Datatable ("StudentInfo")
'Dim importDataSet as DataSet = New Dataset("importDataSet")
'Dim studentInfoTable as DataTable = importDataSet.Tables.Add("StudentInfo")
'newRecord = importDataSet.newrow()
'newRecord("admDate") = "05/04/2004"
I have commented most of the lines just so I can get the lines of code out and review them before I put them in place.