/// summary of WebForm5 /// summary> public class WebForm5: System.Web.UI.Page {protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1; protected System.Data. .SqlClient.SqlCommand sqlSelectCommand1; protected System.Data.SqlClient.SqlConnection sqlConnection1; protected WebApplication1.DataSet1 dataSet11; protected System.Web.UI.WebControls.DataGrid DataGrid1; private void Page_Load (object sender, System.EventArgs e) {// in Place the user code to initialize the page sqldataadapter1.fill (this.DataSet11); this.dataGrid1.datasource = this.dataSet11.tables [0]; this.Database ();}
#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} /// /// Designer Supports the required method - Do not use the code editor to modify the // / this method.
/// summary> private void InitializeComponent () {this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter (); this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand (); this.sqlConnection1 = new System. Data.SqlClient.SqlConnection (); this.dataSet11 = new WebApplication1.DataSet1 ();. ((System.ComponentModel.ISupportInitialize) (this.dataSet11)) BeginInit (); // // sqlDataAdapter1 // this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1; this.sqlDataAdapter1.TableMappings.AddRange (new System.Data.Common.DataTableMapping [] {new System.Data.Common.DataTableMapping ( "Table", "Categories", new System.Data.Common.DataColumnMapping [ ] {New system.data.common.datacolumnMapping ("categoryid", "categoryid"), new system.data.common.datacolumnmapping ("categoryName", "categoryName", new System.Data.Common.DataColumnMapping ( "Description", "Description"), new System.Data.Common.DataColumnMapping ( "Picture", "Picture")})}); // // sqlSelectCommand1 // this.sqlSelectCommand1 .CommandText = "SELECT CategoryID, CategoryName, Description, Picture FROM Categories"; this.sqlSelectCommand1.Connection = this.sqlConnection1; // // sqlConnection1 // this.sqlConnection1.ConnectionString = "workstation id = /" STAR-NICK / " Packet size = 4096; user ID = sa; data source = / "(local) /"; PERS " "
IST security info = false; initial catalog = northwind; pwd = sa; "; // // dataset11 // this.dataset11.datasetName =" dataset1 "; this.dataset11.locale = new system.globalization.cultureInfo (" zh- CN "); this.Load = new system.EventHandler (this.page_load); (this.DataSet11). Endinit ();} #ENDREGON}}
Grid.htc file: / ** *
Title: DataGrid Drake line on the page (in the header, implementing the HTC file) p> *
Description: DataGrid Drake line on the page (in the head Implementation with HTC files) p> *
Copyright: 2005-2005 by mail_ricklee corporation p> *
company: mail_ricklee corporation p> *
CreateTime: 2005-04-23 21 : 30 p> *
modifyTime: p> * @createauthor Li Wei * @version 1.0 * @ModifyAuthor * @vent>