472,353 Members | 1,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 1505
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: AspDotNetDeveloper | last post by:
I'm trying to troubleshoot why my ASP application can no longer send file attachments larger than 100K, and I have eliminated many possibilities...
3
by: Elmo Watson | last post by:
I've been asked to develop a semi-automated type situation where we have a database table (sql server) and periodically, there will be a comma...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a...
1
by: Daniel Manes | last post by:
Some facts: 1) I have an Access database (.mdb file) sitting on my harddrive. 2) I have Visual Studio 2005, Sql Server Express, and Sql Server...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32...
4
by: Goofy | last post by:
The add database ( MDF ) in Visual Studio 2005 seems to be in SQL Server 2005 format as far as I can tell. Does anyone know how I can import tables...
9
by: TC | last post by:
Like a lot of database developers, I often choose Jet for the back- end. I'm starting to worry about what will happen when Jet is deprecated....
1
by: pompair | last post by:
Hi, Could someone give a pointer how to import couple of hundred images into Sql Server 2005 Express Edition database? Is there a tool for it?...
12
by: Darrel | last post by:
I'm still having a hell of a time figuring out this whole SQL Express set up. I finally discovered why I couldn't run the aspnet_regsql...my...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.