newbie needs a sample

  • Thread starter Thread starter Daniel Brower
  • Start date Start date
D

Daniel Brower

I am a programmer that is fluent in Visual Basic 6.0, and I am trying to
learn VB .NET. I would like to create an application that imports comma
separated data in a textfile into a database in Access or SQL Server. I am
familiar with ADO, but not with ADO .NET. Would someone be kind enough to
send me a sample project to get me started?

Daniel
 
Actually, ADO.NET is not particularly good at importing delimited files.
Sure, it can be done using JET and even using FileIO, but it's much better
to use DTS or BCP to handle bulk data. I would pick up a book on ADO.NET
(there are about 35 of them at last count) and use the examples there.

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
What are DTS and BCP?


William (Bill) Vaughn said:
Actually, ADO.NET is not particularly good at importing delimited files.
Sure, it can be done using JET and even using FileIO, but it's much better
to use DTS or BCP to handle bulk data. I would pick up a book on ADO.NET
(there are about 35 of them at last count) and use the examples there.

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
DTS: Data Transformation Services. Look into Books Online for SQL
Server. very handy dandy tool for interacting with different data
stores.
 
-----Original Message-----
I am a programmer that is fluent in Visual Basic 6.0, and I am trying to
learn VB .NET. I would like to create an application that imports comma
separated data in a textfile into a database in Access or SQL Server. I am
familiar with ADO, but not with ADO .NET. Would someone be kind enough to
send me a sample project to get me started?

Daniel


.
Hi Daniel;

The process for importing text files in ADO.net is pretty
complicated. you will need to use an ODBCdataAdapter to
open your file. Then you will have to define the table
structure that you want so that you have what is called A
strongly type dataset.

I would recommend that you do some research first. And
that you check out these books:

Applied ADO.net;Building Data-Driven Solutions by Mahesh
Chand and Davud Talbot from APress. On pg. 388 of CHapter
10 - Working with ODBC.net Data Provider they have an
good example of importing a text file.

An a great reference book is Microsoft ADO.net - Core
Reference by David Sceppa. David is on the Visual
Basic.net development team and specializes in data access.
The guy knows his stuff.

I hope this information can help you out.

Good Luck,

Gordon Goddard
 
-----Original Message-----
What are DTS and BCP?
Vaughn is talking about two facilities in SQL 2000.

DTS - Data Transformation Services and BCP - Bulk Copy
Program. DTS is a way to import and export data between
heterogeneous data sources using an OLE DB provider and
to transfer data between SQL server copies on a network.
Bulk copy does exactly what it says it does copies data
from a table to textfile, table, etc. very quickly. An
example of BCP would be like :

sp_msForEachTable
@Command1="master..xp_cmdshell
'BCP NorthWind.? out C:\?.txt -S
Northwind -U sa -P -n' "

Hope this answers yout question.

Gordon
 
Back
Top