Solved

Adding new records to an SQL database via vb.net

Posted on 2004-08-26
2
157 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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