By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,373 Members | 1,792 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,373 IT Pros & Developers. It's quick & easy.

CSV to DGV to SQL

KodeKrazy
P: 32
I have an app that reads a CSV file (catalog), extrapolates the available data, and then writes it to a DataGridView (unbound) so that the user may add/edit some of the missing/erroneous values prior to posting it to the SQL DB (existing table). After doing some research, I find that I probably should have written the data to a DataSet/DataTable before populating the DGV with the data. HOWEVER, I have already written several hundred lines of code to parse all of the, sometimes very convoluted, data and write it to the DGV, now I just need to know the best way to get it from the DGV and into the SQL DB. I intend to have the proc induced by a button click event when the user finishes editing. I already have my SQL connection string defined in my app.config file.

I guess what I should be asking is; Is it better to create the DataSet/DataTable at runtime or design time? If I created it at design time, would I bind it to the DGV then, or with code @ runtime?

Any help is greatly appreciated.

Thanks,

KK
May 5 '08 #1
Share this Question
Share on Google+
1 Reply


Dököll
Expert 100+
P: 2,364
I have an app that reads a CSV file (catalog), extrapolates the available data, and then writes it to a DataGridView (unbound) so that the user may add/edit some of the missing/erroneous values prior to posting it to the SQL DB (existing table). After doing some research, I find that I probably should have written the data to a DataSet/DataTable before populating the DGV with the data. HOWEVER, I have already written several hundred lines of code to parse all of the, sometimes very convoluted, data and write it to the DGV, now I just need to know the best way to get it from the DGV and into the SQL DB. I intend to have the proc induced by a button click event when the user finishes editing. I already have my SQL connection string defined in my app.config file.

I guess what I should be asking is; Is it better to create the DataSet/DataTable at runtime or design time? If I created it at design time, would I bind it to the DGV then, or with code @ runtime?

Any help is greatly appreciated.

Thanks,

KK
Pretty fancy way of explaining what you hope to achieve... Would you like to post your code also, you might get more hits that way, or another idea may be presented.

Give that a try...
May 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.