Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Access
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 25-Dec-12 0:02am
09hadi703
Comments
chester_it21 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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!
  Permalink  
Comments
09hadi at 25-Dec-12 6:21am
   
Thank you, it worked perfectly
09hadi at 25-Dec-12 6:55am
   
can u help me solve the timeout now?
Zoltán Zörgő at 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)



Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 25 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100