Hello all, I'm somewhat new to programming but I had a quick question. I have created a program to take a text file and convert it into a datatable. Unfortunately, however, I seem unable to attach this file to a database. I am getting an invalid object error stating that there is no table named "DataTable"
Here is my code for attaching to the database. Thank you very much in advance!
Private Sub AddTableToDataBase(ByVal dataTable As DataTable) Dim objConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("InitialCatalog").ConnectionString) Dim ds As DataSet = New DataSet Dim dataAdapter As New SqlDataAdapter("Select * From DataTable", objConn) Dim cmd As SqlCommandBuilder ds.Tables.Add(dataTable) dataAdapter.Fill(dataTable) cmd= New SqlCommandBuilder(dataAdapter) dataAdapter.Update(ds, "DataTable")