|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Using .NET to import a delimited text file into an Access databaseI have been attempting for the past two days to create a fast and efficient way of importing data from a delimited text file into an Access database. I've (finally) found out how to get the text file into a DataSet using the OLE DB classes and have no problems viewing the data. Now I cannot seem to put it into an Access database! I've tried using various methods available to the DataSet and DataAdapter classes and checked out many web references on how to work with these classes. But the references aren't of much assistance and using the methods for the classes, while able to compile and run successfully, does not actually put the data into the Access database! The only way I've found to import the data is to enumerate through the DataRows of the DataSet, create an INSERT statement from the data, and perform the query. Given the proported functionality of .NET, there has to be a faster, more efficient, and above all simple way of doing this! Can anyone provide me with some pointers, books, or sites to assist me? Thanks. <t***@whocallmetim.net> wrote in message
Show quoteHide quote news:1103663913.352552.3970@c13g2000cwb.googlegroups.com... Actually this is very simple, and much faster in Access. Just open the > Greetings! > > I have been attempting for the past two days to create a fast and > efficient way of importing data from a delimited text file into an > Access database. I've (finally) found out how to get the text file > into a DataSet using the OLE DB classes and have no problems viewing > the data. Now I cannot seem to put it into an Access database! > > I've tried using various methods available to the DataSet and > DataAdapter classes and checked out many web references on how to work > with these classes. But the references aren't of much assistance and > using the methods for the classes, while able to compile and run > successfully, does not actually put the data into the Access database! > The only way I've found to import the data is to enumerate through the > DataRows of the DataSet, create an INSERT statement from the data, and > perform the query. Given the proported functionality of .NET, there > has to be a faster, more efficient, and above all simple way of doing > this! > Access database and add a linked table pointing to your text file. Then Insert into MyTable select * from MyLinkedTextFile .. It .NET is's much harder more indirect, and much much slower because you have to generate single-row inserts for each row. David
Other interesting topics
How to make this better and faster?
How to screen scrap a non-browser based object? compress specific data .NET competes with java-script Direction and suggestions needed multiline toolbarbuttons MSIL using VS.Net 2003 with Framework 2 beta FileSystemWatcher event fired only once System.Net.Socket and Linux Server |
|||||||||||||||||||||||