📄 addtitle_typedds.aspx.cs
字号:
this.titleDataSet1 = new Chapter_09.TitleDataSet();
((System.ComponentModel.ISupportInitialize)(this.titleDataSet1)).BeginInit();
//
// daTitles
//
this.daTitles.DeleteCommand = this.sqlDeleteCommand1;
this.daTitles.InsertCommand = this.sqlInsertCommand1;
this.daTitles.SelectCommand = this.sqlSelectCommand1;
this.daTitles.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "titles", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("title_id", "title_id"),
new System.Data.Common.DataColumnMapping("title", "title"),
new System.Data.Common.DataColumnMapping("type", "type"),
new System.Data.Common.DataColumnMapping("pub_id", "pub_id"),
new System.Data.Common.DataColumnMapping("price", "price"),
new System.Data.Common.DataColumnMapping("advance", "advance"),
new System.Data.Common.DataColumnMapping("royalty", "royalty"),
new System.Data.Common.DataColumnMapping("ytd_sales", "ytd_sales"),
new System.Data.Common.DataColumnMapping("notes", "notes"),
new System.Data.Common.DataColumnMapping("pubdate", "pubdate")})});
this.daTitles.UpdateCommand = this.sqlUpdateCommand1;
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT title_id, title, type, pub_id, price, advance, royalty, ytd_sales, notes, " +
"pubdate FROM dbo.titles";
this.sqlSelectCommand1.Connection = this.cnPubs;
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = @"INSERT INTO dbo.titles(title_id, title, type, pub_id, price, advance, royalty, ytd_sales, notes, pubdate) VALUES (@title_id, @title, @type, @pub_id, @price, @advance, @royalty, @ytd_sales, @notes, @pubdate); SELECT title_id, title, type, pub_id, price, advance, royalty, ytd_sales, notes, pubdate FROM dbo.titles WHERE (title_id = @title_id)";
this.sqlInsertCommand1.Connection = this.cnPubs;
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@title_id", System.Data.SqlDbType.NVarChar, 6, "title_id"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@title", System.Data.SqlDbType.NVarChar, 80, "title"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@type", System.Data.SqlDbType.NVarChar, 12, "type"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@pub_id", System.Data.SqlDbType.NVarChar, 4, "pub_id"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@price", System.Data.SqlDbType.Money, 8, "price"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@advance", System.Data.SqlDbType.Money, 8, "advance"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@royalty", System.Data.SqlDbType.Int, 4, "royalty"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ytd_sales", System.Data.SqlDbType.Int, 4, "ytd_sales"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@notes", System.Data.SqlDbType.NVarChar, 200, "notes"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@pubdate", System.Data.SqlDbType.DateTime, 8, "pubdate"));
//
// sqlUpdateCommand1
//
this.sqlUpdateCommand1.CommandText = @"UPDATE dbo.titles SET title_id = @title_id, title = @title, type = @type, pub_id = @pub_id, price = @price, advance = @advance, royalty = @royalty, ytd_sales = @ytd_sales, notes = @notes, pubdate = @pubdate WHERE (title_id = @Original_title_id) AND (advance = @Original_advance OR @Original_advance IS NULL AND advance IS NULL) AND (notes = @Original_notes OR @Original_notes IS NULL AND notes IS NULL) AND (price = @Original_price OR @Original_price IS NULL AND price IS NULL) AND (pub_id = @Original_pub_id OR @Original_pub_id IS NULL AND pub_id IS NULL) AND (pubdate = @Original_pubdate) AND (royalty = @Original_royalty OR @Original_royalty IS NULL AND royalty IS NULL) AND (title = @Original_title) AND (type = @Original_type) AND (ytd_sales = @Original_ytd_sales OR @Original_ytd_sales IS NULL AND ytd_sales IS NULL); SELECT title_id, title, type, pub_id, price, advance, royalty, ytd_sales, notes, pubdate FROM dbo.titles WHERE (title_id = @title_id)";
this.sqlUpdateCommand1.Connection = this.cnPubs;
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@title_id", System.Data.SqlDbType.NVarChar, 6, "title_id"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@title", System.Data.SqlDbType.NVarChar, 80, "title"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@type", System.Data.SqlDbType.NVarChar, 12, "type"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@pub_id", System.Data.SqlDbType.NVarChar, 4, "pub_id"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@price", System.Data.SqlDbType.Money, 8, "price"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@advance", System.Data.SqlDbType.Money, 8, "advance"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@royalty", System.Data.SqlDbType.Int, 4, "royalty"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ytd_sales", System.Data.SqlDbType.Int, 4, "ytd_sales"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@notes", System.Data.SqlDbType.NVarChar, 200, "notes"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@pubdate", System.Data.SqlDbType.DateTime, 8, "pubdate"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_title_id", System.Data.SqlDbType.NVarChar, 6, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "title_id", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_advance", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "advance", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_notes", System.Data.SqlDbType.NVarChar, 200, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "notes", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_price", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "price", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_pub_id", System.Data.SqlDbType.NVarChar, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "pub_id", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_pubdate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "pubdate", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_royalty", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "royalty", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_title", System.Data.SqlDbType.NVarChar, 80, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "title", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_type", System.Data.SqlDbType.NVarChar, 12, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "type", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ytd_sales", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ytd_sales", System.Data.DataRowVersion.Original, null));
//
// sqlDeleteCommand1
//
this.sqlDeleteCommand1.CommandText = @"DELETE FROM dbo.titles WHERE (title_id = @Original_title_id) AND (advance = @Original_advance OR @Original_advance IS NULL AND advance IS NULL) AND (notes = @Original_notes OR @Original_notes IS NULL AND notes IS NULL) AND (price = @Original_price OR @Original_price IS NULL AND price IS NULL) AND (pub_id = @Original_pub_id OR @Original_pub_id IS NULL AND pub_id IS NULL) AND (pubdate = @Original_pubdate) AND (royalty = @Original_royalty OR @Original_royalty IS NULL AND royalty IS NULL) AND (title = @Original_title) AND (type = @Original_type) AND (ytd_sales = @Original_ytd_sales OR @Original_ytd_sales IS NULL AND ytd_sales IS NULL)";
this.sqlDeleteCommand1.Connection = this.cnPubs;
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_title_id", System.Data.SqlDbType.NVarChar, 6, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "title_id", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_advance", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "advance", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_notes", System.Data.SqlDbType.NVarChar, 200, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "notes", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_price", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "price", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_pub_id", System.Data.SqlDbType.NVarChar, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "pub_id", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_pubdate", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "pubdate", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_royalty", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "royalty", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_title", System.Data.SqlDbType.NVarChar, 80, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "title", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_type", System.Data.SqlDbType.NVarChar, 12, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "type", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ytd_sales", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ytd_sales", System.Data.DataRowVersion.Original, null));
//
// cnPubs
//
this.cnPubs.ConnectionString = "workstation id=GEI_XP1;packet size=4096;integrated security=SSPI;data source=\"(lo" +
"cal)\\VSdotNET\";persist security info=False;initial catalog=pubs";
//
// titleDataSet1
//
this.titleDataSet1.DataSetName = "TitleDataSet";
this.titleDataSet1.Locale = new System.Globalization.CultureInfo("en-US");
this.Load += new System.EventHandler(this.Page_Load);
((System.ComponentModel.ISupportInitialize)(this.titleDataSet1)).EndInit();
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -