Solved

Adding new records to an SQL database via vb.net

Posted on 2004-08-26
2
158 Views
Last Modified: 2010-04-23
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)
            myConnection.Open()
            '''''Write Record.......
            'Dim studentInfo table as DataTable = New Datatable ("StudentInfo")
            'Dim importDataSet as DataSet = New Dataset("importDataSet")
            'Dim studentInfoTable as DataTable = importDataSet.Tables.Add("StudentInfo")
            'studentInfoTable.Columns.Add("admDate", Type.GetType("System.Date"))
            'newRecord = importDataSet.newrow()
            'newRecord("admDate") = "05/04/2004"
            'importDataSet.Rows.Add(newRecord)
            'studentInfo.AcceptChanges()
            'myAdapter.Update(importDataSet)

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.


Thanks
Kenny


0
Comment
Question by:kwh3856
2 Comments
 
LVL 5

Accepted Solution

by:
thenrich earned 500 total points
ID: 11917028
0
 

Author Comment

by:kwh3856
ID: 11973004
Thenrich,

Thanks for the help..


Kenny
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question