It's really easy to upload an excel spreadsheet using DTS in SQL Server 2k and it works great and you can do it using a wizard-like point and click interface in the enterprise manager.
To do this, right click over a table (any table), select "All Tasks", then "Import Data...", and that brings up the DTS Import/Export Wizard. For data source, select "Excel 97-2000". Either that or save your file in CSV format and use one of the *.csv drivers. From there it's pretty easy. You have to make sure the data in your spreadsheet can be converted to the datatypes on the columns in the table you are uploading to. Watch the dates. In my experience its often been easiest to make a new table with no constraints of any kind, and varchar everything, import the data into that table, then use SQL to "massage" it into what I want, and THEN import it to the table(s) I actually want it in.
I don't understand what you mean by "writing it in C#". What do you want to write in C#? A windows form? An ASP.NET site? If you are making an upload form in ASP you will need Office Web Components (OWC).
Neil Timmerman
Programmer
Veris Consulting
|