Open and save Excel file in C# ????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how can i browse and open excel file, show it in Datagrid, then save into
databse (SQLserver) (C#) ???
 
sorry I just posted this in the forum instead of hitting reply, so here it is
again:

use browse file control in WinForms toolbarand select filter property to be
of excel file type. this is as straighforward as it can be.

open excel file in datagrid? you need to have some type of custom format -
excel files contain macros, pictures, embedded objects. How do you plan to
display them?

One suggestions that springs to mind would be to parse excel's file contents
using office object model, stick it into Data object, have the datagrid
populate from the data object, and so you can also persist the data object in
you sql database.
 
Hi npqk

One way that you can do this is to set up a data source in the Data Sources
control panel, then use the System.Data.OleDb ADO.NET provider to load the
spreadsheet data into a DataSet, and bind that to your DataGrid. That doesn't
handle your requirements entirely though.

Perhaps asking in the Office groups for an alternative perspective would be
a good idea.

Nigel Armstrong
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top