.NET ConnectionString Encyption
April 25th, 2007
The following command will encrypt your connection sting in your web.config file. The connection string must all ready be in place.
For C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
-pkm switch encrypts the machine.config rather and web.config (default).
aspnet_regiis.exe -pef "connectionStrings" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config" -prov "DataProtectionConfigurationProvider"
Post Comment Now
SharePoint Error PublicKeyToken=b77a5c561934e089 failed
April 18th, 2007
ASP.NET Excel Function
April 18th, 2007
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(); }
Post Comment Now
WSS 3.0 API Notes
April 3rd, 2007

