Solved

Adding new records to an SQL database via vb.net

Posted on 2004-08-26
2
154 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
Comment Utility
0
 

Author Comment

by:kwh3856
Comment Utility
Thenrich,

Thanks for the help..


Kenny
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now