The Following C# code is used to Export data from ASP.NET to Excel with special characters try { Response.ContentType = "application/vnd.ms-excel 8.0"; Response.Charset = ""; Response.ContentEncoding = System.Text.Encoding.Default; this.EnableViewState = false; System.IO.StringWriter ObjWriter = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter ObjHtmlTextWriter = new System.Web.UI.HtmlTextWriter(ObjWriter); rptUserDetails.RenderControl(ObjHtmlTextWriter); //dgdInitiative is the Grid name which is to be exported Response.Write(ObjWriter.ToString()); string strhtml = ObjHtmlTextWriter.ToString(); Response.AppendHeader("content-disposition", "attachment;filename=Users.xls"); Response.End(); } catch (System.Exception ex) { string strMsg = ex.Message; }
From The Following link you can find out Nice new things coming with the VS 2010 and .NET 4 release. Scott Guthrie had explain it so nice. New Things Coming With The VS 2010 and .NET 4 release.
Why the Elephants Don't Run? A number of years ago, I had the rather unique experience of being backstagein Madison Square Garden, in New York, during the Ringling Brothers Barnum &Bailey Circus. To say the least, it was a fascinating experience. I was ableto walk around looking at the lions, tigers, giraffes and all the othercircus animals. As I was passing the elephants, I suddenly stopped, confusedby the fact that these huge creatures were being held by only a small ropetied to their front leg. No chains, no cages. It was obvious that theelephants could, at any time, break away from their bonds but for somereason, they did not. I saw a trainer near by and asked why these beautiful,magnificent animals just stood there and made no attempt to get away."Well," he said, "when they are very young and much smaller we use the samesize rope to tie them and, at that age, it's enough to hold them. As theygrow up, they are conditioned to believe they cannot break away...
Comments