This function written in c# builds a MS excel out of a dataSet.
private DataSet dataSet = new DataSet(); private DataView dView = new DataView(); private void LoadPeople() { SqlConnection conn = new SqlConnection("Data Source=asdf;User ID=asdf;Password=asdf;Database=Directory"); SqlDataAdapter dAdapter = new SqlDataAdapter("SELECT * FROM People", conn); dAdapter.Fill(dataSet, "peeps"); dView.Table = dataSet.Tables["peeps"]; personel_cnt = dView.Count; dView.Table.Columns.Add("is_a_member"); conn.Close(); } private void buildExcelReport() { DataSet dsExport = dataSet; System.IO.StringWriter tw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw); DataGrid dgGrid = new DataGrid(); dgGrid.DataSource = dsExport; //Report Header hw.WriteLine("My Super Duper Excel Report"); hw.WriteLine("<br>∓nbsp;"); // Get the HTML for the control. dgGrid.HeaderStyle.Font.Bold = true; dgGrid.DataBind(); dgGrid.RenderControl(hw); // Write the HTML back to the browser. Response.ContentType = "application/vnd.ms-excel"; this.EnableViewState = false; Response.Write(tw.ToString()); Response.End(); }
Due to some new enhancements in IIS 6.0, users may encounter a significant delay before receiving the content on the page. This can be a great annoyance for the users and prevent them from visiting your site. To eliminate this delay, follow these instructions:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ASP\Parameters] "DisableLazyContentPropagation"=dword:00000001
With the new release of Visual Studio (VS) 2005, you would think that it would have full support for classic ASP when working in a directory. This is not the case. There are some hacks out there, however none are fully functional and some require that you set the page directive on every page you want highlighting and intellisense. Of course this will break some of your pages.
For those who want the power of VS (mainly Intellisense), you still need to use vs 2003 until MS makes a fully functional .asp template for VS 2005.
This tutorial will walk you through the process of creating a Solution that allows you to edit your classic ASP in VS 2003. The site must be accessible though windows explorer (C:\ or mapped drives).
Now when you start the solution, all the sites and files will be listed from within VS 2003. You now have html, javascript, and vbscript intellisense. You also get param lists when you call functions/subs that are on the same working page. Sweet!
Notes: