Question

Locked

How to save data in DataGridView to new SQL Server table

By Donald_SUTTON ·
I have data loaded from a csv file into a datagridview control and want to save this to a new SQL Server table in an existing dataset. I am first checking that the field names match existing or are OK as MS SQLServer fieldnames. I am a beginner with SQL Server but have had a lot of experience with MS Access. The dataset size is beyond Access. The csv files once loaded into an interim table will be edited to ensure that the data conforms with the standard required for the main server table and either appended/inserted to the main table or if updates will have existing records updated. The interim table will be deleted before creating a new table. Using VB 2008 and MS SQL Server Express 2005

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Problem Solved

by Donald_SUTTON In reply to How to save data in DataG ...

I have solved the above problem by:
1) First checking for existing interim table and deleting same if it exists.
2) Create new table based on schema of csv file.
3) Using sqlBulkCopy to fill the new table.
4) Next step is create relationships of imported table data.
5) Create query to update or insert the data to a main table.

Collapse -

Excellent

by Shellbot In reply to Problem Solved

Its refreshing to see someone work at solving a problem rather than just asking a question and never returning..

I hope you gave yourself a thumbs up??

Back to Networks Forum
2 total posts (Page 1 of 1)  

Related Forums