?
Solved

Adding new records to an SQL database via vb.net

Posted on 2004-08-26
2
Medium Priority
?
162 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

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