Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding new records to an SQL database via vb.net

Posted on 2004-08-26
2
Medium Priority
?
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
thenrich earned 2000 total points
ID: 11917028
0
 

Author Comment

by:kwh3856
ID: 11973004
Thenrich,

Thanks for the help..


Kenny
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

618 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