实训学习文档(c# .net)(Training study document (c#.Net)).docVIP

  • 4
  • 0
  • 约7.13千字
  • 约 17页
  • 2017-10-06 发布于河南
  • 举报

实训学习文档(c# .net)(Training study document (c#.Net)).doc

实训学习文档(c# .net)(Training study document (c#.Net))

实训学习文档(c# .net)(Training study document (c#.Net)) (1) add data code to the table: A, if (dt.Rows.Count== 0) / / a data table defined in DT itself { DataRow Dr = dt.NewRow (); Dr[AreaID = = 0; Dr[AreaName] = - no geographical information - related; Dr[TypeName = =; Dt.Rows.Add (DR); } Two, DDLCategory.Items.Insert (0, new, ListItem) (not recommended line, 0)); Three, GVPic.Rows[0].Cells[0].Text =; (2) the error handling should be based on the number of error codes, such as: EX.Number==2627 stands for the same data and cannot be used Cmd.parameters.add (@34, sqldbT) value= (3) / / SDR (SQLDataread) represents a For a real input value: I. entity.AdminID=sdr[ADminID,].toString () Two, entity.AdminID=sdr.GetString[, AdminID,].tosting (); (4) cmd=new SqlCommand (con.GetOpen), (); / / used to add code to open the database and database (5) sda=new SqlDataAdapter (CMD); / / SQlDATAREader Sda.Fill (DT); / / add data on the data sheet (6) clear the information of the data tables in the corresponding style in the page Foreach (System.Web.UI.Control, control, in, Controls) { For (int i = 0; I control.Controls.Count; i++) { If (control.Controls[i], is, System.Web.UI.WebControls.TextBox) { System.Web.UI.WebControls.TextBox TB = (System.Web.UI.WebControls.TextBox) control.Controls[i]; Tb.Text =; } } } (7) database connections SqlConnection, con=, null, con=new, Sqlconnection (STR); If (con.State==, ConnectionState.Closed) {con.Open ()} Con.ConnectionString = ConfigurationSettings.AppSettings[, ConStr,].ToString (); I. con.ConnectionString = Data Source=.; Initial Catalog=hjyDB; Integrated Security=True; Two, add name = Constr connectionString= Data Source=.; Initial Catalog=hjyDB; Integrated Security=True / Con.ConnectionString = ConfigurationManager.ConnectionStrings[, Constr,].ToString (); (8) check to see if you are logged in Public, bool, CheckLogin () { If (HttpContext.Current.Session[AdminID] = = null) { HttpContext.Current.Response.Write (scripttop.location.href=Login.aspx

文档评论(0)

1亿VIP精品文档

相关文档