tag:blogger.com,1999:blog-32696142.post4044704021688716501..comments2024-02-19T01:02:59.086-06:00Comments on ASP.Net, C#, SQL, JQuery, Sharepoint: Export Datagrid Data To Excel ASP.netUnknownnoreply@blogger.comBlogger6125tag:blogger.com,1999:blog-32696142.post-12790966590020125842010-12-29T23:27:35.458-06:002010-12-29T23:27:35.458-06:00Thanks It saved my time. :)Thanks It saved my time. :)Edyhttps://www.blogger.com/profile/01257032595271888999noreply@blogger.comtag:blogger.com,1999:blog-32696142.post-10459280624300400272010-07-29T12:58:56.062-05:002010-07-29T12:58:56.062-05:00I use this code with my gridview.. I have two prob...I use this code with my gridview.. I have two problems<br /><br />1) I have a button making the gridview visible.. The button to export then gives this error: <br /><br />Control 'SortTable' of type 'GridView' must be placed inside a form tag with runat=server.<br /><br />2) If I keep the gridview hidden, the export button works, but the resulting xls has NO data..<br /><br /><br Rohan Jainhttps://www.blogger.com/profile/00090693506522160159noreply@blogger.comtag:blogger.com,1999:blog-32696142.post-58148867649552827832009-05-27T16:45:18.348-05:002009-05-27T16:45:18.348-05:00@Sahil
Change definition to something like
privat...@Sahil<br /><br />Change definition to something like<br />private void ExportToExcel(string strFileName,<B>Gridview dg</B>)<br /><br />This code was developed in .Net 1.1, where in we used Datagrid, but for .Net 2.0 or .Net 3.5 you would be normally using GridView so change the reference accordingly.DotNetGutshttps://www.blogger.com/profile/12732063013510099746noreply@blogger.comtag:blogger.com,1999:blog-32696142.post-75499641915852100552009-05-27T14:58:16.911-05:002009-05-27T14:58:16.911-05:00Hi,
i m sahil i m using your code but i m geti...Hi,<br /> i m sahil i m using your code but i m geting only one error can you tell me.about this error is:-<br /><br />'DataGrid' is an ambiguous reference between 'System.Web.UI.WebControls.DataGrid' And 'System.Windows.Forms.DataGrid'<br /><br />Can you tell me please..<br /><br /><br />SahilUnknownhttps://www.blogger.com/profile/12933440461907834889noreply@blogger.comtag:blogger.com,1999:blog-32696142.post-71879946565443278362008-08-27T21:25:00.000-05:002008-08-27T21:25:00.000-05:00Hey, Very useful piece of code. Works great. I hav...Hey, Very useful piece of code. Works great. I have been looking around the net for a simple solution like this. Great Work!M3mph15https://www.blogger.com/profile/15499496573380393152noreply@blogger.comtag:blogger.com,1999:blog-32696142.post-17301923087406377692008-07-10T10:34:00.000-05:002008-07-10T10:34:00.000-05:00hi, hey, i use your code and it was very handy, bu...hi, hey, i use your code and it was very handy, but when i try to implement it on an imageButton, like an element inside the gridview, it doesn`t appears any message.<BR/><BR><BR><BR/>The exception thrown is <BR/><I>{Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}</I><BR/><BR><BR><BR/>Does you or anybody knows how to solve this item?<BR/Marcos Luquehttps://www.blogger.com/profile/00323172233743851883noreply@blogger.com