S
Steve Klett
(sorry, sent too soon)
Hi-
OK, I'm very new to data conversion, ado.net, etc.
What I need to do is read a HUGE excel file that has a bunch of data(about
20 columns X 1000 rows) and insert it into a yet defined MSDE database.
I want to structure the database so that it is fairly relational, as clean
as possible for what the project is worth, etc. I can handle this part,
what I'm facing right now is:
1) the beast method to execute the actual insert calls. Should I use a
DataSet, load it up with everything, then update it to the database? The
database is local, so speed is not a huge concern and this will be ran 1
time
2) How to relate the xls columns and data with the appropriate MSDE tables
and columns. The method that comes to mind is to write a very long SQL
string or SPROC, then feed it about 20 parameters. This seems like it could
get ugly.
3) Let's say that I have an Excel column named "ReasonForReturn" where the
office staff has entered any numbers of text descriptions for each row, some
repeat, some are slightly different some very different. Now, I would like
to store these reasons in a table and then (I don't know the term) but use
their FK in the main table to JOIN them together later. Easy. Except, as I
encounter a new reason in the Excel file, I need to query the DB to see if
it exists, if not, I need to insert it, get the Id, then do the main Insert
utilizing the FK for this new reason. CONFUSING and UGLY. Is there some
new amazing ado.net class that can assist with this?
4) As off right now I'm planning on looping through the DataRows in my
DataTable of Excel data. Along the way I would do whatever I needed to get
the data into the MSDE store. Is this a good approach? Is there some new
class that assists with importing or syncing in batch?
As you can tell, I'm a newbie. I can do this, it's just a matter of
utilizing ADO the best way possible... which as of this writing, I don't
know how to do. If you have any pointers, please share.
Thanks in advance,
Steve
Hi-
OK, I'm very new to data conversion, ado.net, etc.
What I need to do is read a HUGE excel file that has a bunch of data(about
20 columns X 1000 rows) and insert it into a yet defined MSDE database.
I want to structure the database so that it is fairly relational, as clean
as possible for what the project is worth, etc. I can handle this part,
what I'm facing right now is:
1) the beast method to execute the actual insert calls. Should I use a
DataSet, load it up with everything, then update it to the database? The
database is local, so speed is not a huge concern and this will be ran 1
time
2) How to relate the xls columns and data with the appropriate MSDE tables
and columns. The method that comes to mind is to write a very long SQL
string or SPROC, then feed it about 20 parameters. This seems like it could
get ugly.
3) Let's say that I have an Excel column named "ReasonForReturn" where the
office staff has entered any numbers of text descriptions for each row, some
repeat, some are slightly different some very different. Now, I would like
to store these reasons in a table and then (I don't know the term) but use
their FK in the main table to JOIN them together later. Easy. Except, as I
encounter a new reason in the Excel file, I need to query the DB to see if
it exists, if not, I need to insert it, get the Id, then do the main Insert
utilizing the FK for this new reason. CONFUSING and UGLY. Is there some
new amazing ado.net class that can assist with this?
4) As off right now I'm planning on looping through the DataRows in my
DataTable of Excel data. Along the way I would do whatever I needed to get
the data into the MSDE store. Is this a good approach? Is there some new
class that assists with importing or syncing in batch?
As you can tell, I'm a newbie. I can do this, it's just a matter of
utilizing ADO the best way possible... which as of this writing, I don't
know how to do. If you have any pointers, please share.
Thanks in advance,
Steve