Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to export a gridview into an access database. I have the same header created in the database. Just wanted to know how to export gridview into that database. Any code sample would be highly appreciated. The header for the gridview and database is as follows:
SID,Degree,Semester,Course,Marks,Discipline
Posted
Comments
chester_it21 25-Dec-12 6:19am    
I think, so far no such thing straight ... I mean, from a Gridview to an Access database ..
My solution "you must enter his data per row of the GridView to the database access .."

1 solution

You will not be able to generate Access database file on client side.
You have to dynamically create the access database file on server side, and serve it as downloadable content.

For how to serve dynamically generated file, have a look here:
Create and download a text file from a web page[^] and here: http://chrisfulstow.com/sending-dynamically-generated-files-to-the-browser-in-asp-net[^]

For how to generate an mdb file (catalog), look here: http://support.microsoft.com/?id=317867[^](it is vb.net, but really simple). The good news is, that you don't need to have access installed!

Be aware, that generating the file might take longer than the execution timeout!
 
Share this answer
 
Comments
09hadi 25-Dec-12 6:21am    
Thank you, it worked perfectly
09hadi 25-Dec-12 6:55am    
can u help me solve the timeout now?
Zoltán Zörgő 25-Dec-12 7:11am    
First look here: http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.executiontimeout.aspx
If the execution takes really long (above 30s) or there is a cnahce to have too high load on the server, you should make it asnyc: create a service, that takes a fifo (from a db table for example), where you put the mdb generation parameters. On request you just add a new job to the fifo, and notify the user, that the generation has begone. When finished, you put the result in an "inbox" like function on the site. On client side you can make scheduled ajax calls to the backend to check if there is anything in the inbox and notify the user.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900