Exporting to Access using ASP.NET

M

Michael

Does anyone know how to export a data grid from asp.net into microsoft
access? Thanks.

Michael
 
G

Guest

Well, I don't know if this would help but a datagrid is usually bound to a dataset. So, then values in a dataset can be saved to xml. Then, importing xml data in MS Access may be one way. I have not done any research on this so I am just giving you some ideas. Otherwise, you might have to tamper with the Access object model to loop through the values in the datagrid and write them to an access table. Hope this points you in the right direction. I will be looking out for any other suggestions as well.
 
K

Kevin Spencer

You're definitely on the right track. A DataGrid is a server-side component
that DISPLAYS data on the client-side. Therefore, you can't export data from
it. You CAN, however, do one or more INSERTs from the data that is on the
server-side (which the DataGrid is bound to), either in a DataTable or
DataSet. However, it's not necessary to save the data to XML; this would be
an additional unnecessary manipulation of the data.

Data isn't "exported" en masse. It is inserted one row at a time, regardless
of how it may seem to a user. Just loop through the rows and do INSERTs on
each one.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Tampa .NET Koder said:
Well, I don't know if this would help but a datagrid is usually bound to a
dataset. So, then values in a dataset can be saved to xml. Then, importing
xml data in MS Access may be one way. I have not done any research on this
so I am just giving you some ideas. Otherwise, you might have to tamper
with the Access object model to loop through the values in the datagrid and
write them to an access table. Hope this points you in the right direction.
I will be looking out for any other suggestions as well.
 
G

Guest

Did I say loop throught the datagrid? Yes I did. I should have known better i meant to say dataset or loop throught the items within each datatable. Yes, I do agree saving the data as xml would be a extra unessary step
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top