473,414 Members | 1,675 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 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 1553
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 already, but I'm running out of ideas. I think I...
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 delimited file from which we need to import the data,...
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 char buffer) and copies the contents of the byte...
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 Management Studio Express. 3) I do *not* have...
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 databases), what would be your first instinct on how to...
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 ( without having to start writing queries ) from...
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. Ostensibly, Jet users like me must switch to SQL Server...
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? Can it be done with Sql Management Studio or is...
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 local sql server wasn't running. I turned that on,...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.