469,623 Members | 1,532 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Importing a file into SQL Server Express using C# Express

I have a data file with proprietary database formatting from an old DOS programme and want to
extract data from it and import it into SQL Server Express using C# Express. I've managed to work
out how the data is stored in the file by using a hex editor, but don't know how to add it to an SQL
Server Express database using C# Express.

I've watched the Learn Visual Studio.Net beginners videos, but they only tell me how to enter data
though the IDE by typing it.

Example, if I have a table called Customers and a column CustomerId and a column called Name, how do
I set the Name with a string read from my file, and how do I make sure that it goes into the correct
row - I will be supplying the CustomerId, but need to know how to assign this in code too.
Jun 2 '06 #1
2 1458
mmm
No one has answered you yet on this, so here goes
I think it all boils down to sql statements and understanding that
If you have the correct values and you know the corresponing columns, its a
simple thing of either using an update statement or an insert statement.
Read up on SQL statements

Insert into mytable ('column name1', 'columnname2') values ('value1',value2)
or
Update mytable set 'column name1' = 'value1', columnname2 = value2 where
somefield = somevalue

Robert

"John" <-> wrote in message news:%2****************@TK2MSFTNGP05.phx.gbl...
I have a data file with proprietary database formatting from an old DOS programme and want to extract data from it and import it into SQL Server Express using C# Express. I've managed to work out how the data is stored in the file by using a hex editor, but don't know how to add it to an SQL Server Express database using C# Express.

I've watched the Learn Visual Studio.Net beginners videos, but they only tell me how to enter data though the IDE by typing it.

Example, if I have a table called Customers and a column CustomerId and a column called Name, how do I set the Name with a string read from my file, and how do I make sure that it goes into the correct row - I will be supplying the CustomerId, but need to know how to assign this in code too.

Jun 4 '06 #2
Thanks very much for your reply. I'm a complete beginner, so I guess the question did sound a bit
basic.

The videos make a lot of use of datasets, which seem like a good idea. How do I add items to the
dataset rather than directly to the database?

Thanks again for your help... John
"Robert Bravery" <me@u.com> wrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
mmm
No one has answered you yet on this, so here goes
I think it all boils down to sql statements and understanding that
If you have the correct values and you know the corresponing columns, its a
simple thing of either using an update statement or an insert statement.
Read up on SQL statements

Insert into mytable ('column name1', 'columnname2') values ('value1',value2)
or
Update mytable set 'column name1' = 'value1', columnname2 = value2 where
somefield = somevalue

Robert

"John" <-> wrote in message news:%2****************@TK2MSFTNGP05.phx.gbl...
I have a data file with proprietary database formatting from an old DOS programme and want to extract data from it and import it into SQL Server Express using C# Express. I've managed to work out how the data is stored in the file by using a hex editor, but don't know how to add it to an SQL Server Express database using C# Express.

I've watched the Learn Visual Studio.Net beginners videos, but they only tell me how to enter data though the IDE by typing it.

Example, if I have a table called Customers and a column CustomerId and a column called Name, how do I set the Name with a string read from my file, and how do I make sure that it goes into the correct row - I will be supplying the CustomerId, but need to know how to assign this in code too.


Jun 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by AspDotNetDeveloper | last post: by
3 posts views Thread by Elmo Watson | last post: by
7 posts views Thread by Timothy Shih | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.