📄 appdatabasedataset.designer.cs
字号:
}
catch (System.InvalidCastException e) {
throw new System.Data.StrongTypingException("The value for column \'Price\' in table \'Orders\' is DBNull.", e);
}
}
set {
this[this.tableOrders.PriceColumn] = value;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public bool IsServerOrderIdNull() {
return this.IsNull(this.tableOrders.ServerOrderIdColumn);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void SetServerOrderIdNull() {
this[this.tableOrders.ServerOrderIdColumn] = System.Convert.DBNull;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public bool IsProductIdNull() {
return this.IsNull(this.tableOrders.ProductIdColumn);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void SetProductIdNull() {
this[this.tableOrders.ProductIdColumn] = System.Convert.DBNull;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public bool IsQuantityNull() {
return this.IsNull(this.tableOrders.QuantityColumn);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void SetQuantityNull() {
this[this.tableOrders.QuantityColumn] = System.Convert.DBNull;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public bool IsProductNameNull() {
return this.IsNull(this.tableOrders.ProductNameColumn);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void SetProductNameNull() {
this[this.tableOrders.ProductNameColumn] = System.Convert.DBNull;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public bool IsPriceNull() {
return this.IsNull(this.tableOrders.PriceColumn);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void SetPriceNull() {
this[this.tableOrders.PriceColumn] = System.Convert.DBNull;
}
}
public class ProductsRowChangeEvent : System.EventArgs {
private ProductsRow eventRow;
private System.Data.DataRowAction eventAction;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public ProductsRowChangeEvent(ProductsRow row, System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public ProductsRow Row {
get {
return this.eventRow;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
public class OrdersRowChangeEvent : System.EventArgs {
private OrdersRow eventRow;
private System.Data.DataRowAction eventAction;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public OrdersRowChangeEvent(OrdersRow row, System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public OrdersRow Row {
get {
return this.eventRow;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
namespace MobileDevelopersHandbook.DSAExample.AppDatabaseDataSetTableAdapters {
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.ComponentModel.DataObjectAttribute(true)]
public partial class ProductsTableAdapter : System.ComponentModel.Component {
private System.Data.SqlServerCe.SqlCeDataAdapter _adapter;
private System.Data.SqlServerCe.SqlCeConnection _connection;
private System.Data.SqlServerCe.SqlCeCommand[] _commandCollection;
private bool _clearBeforeFill;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public ProductsTableAdapter() {
this.ClearBeforeFill = true;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private System.Data.SqlServerCe.SqlCeDataAdapter Adapter {
get {
if ((this._adapter == null)) {
this.InitAdapter();
}
return this._adapter;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal System.Data.SqlServerCe.SqlCeConnection Connection {
get {
if ((this._connection == null)) {
this.InitConnection();
}
return this._connection;
}
set {
this._connection = value;
if ((this.Adapter.InsertCommand != null)) {
this.Adapter.InsertCommand.Connection = value;
}
if ((this.Adapter.DeleteCommand != null)) {
this.Adapter.DeleteCommand.Connection = value;
}
if ((this.Adapter.UpdateCommand != null)) {
this.Adapter.UpdateCommand.Connection = value;
}
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
if ((this.CommandCollection[i] != null)) {
((System.Data.SqlServerCe.SqlCeCommand)(this.CommandCollection[i])).Connection = value;
}
}
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected System.Data.SqlServerCe.SqlCeCommand[] CommandCollection {
get {
if ((this._commandCollection == null)) {
this.InitCommandCollection();
}
return this._commandCollection;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public bool ClearBeforeFill {
get {
return this._clearBeforeFill;
}
set {
this._clearBeforeFill = value;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void InitAdapter() {
this._adapter = new System.Data.SqlServerCe.SqlCeDataAdapter();
System.Data.Common.DataTableMapping tableMapping = new System.Data.Common.DataTableMapping();
tableMapping.SourceTable = "Table";
tableMapping.DataSetTable = "Products";
tableMapping.ColumnMappings.Add("ProductId", "ProductId");
tableMapping.ColumnMappings.Add("ProductName", "ProductName");
tableMapping.ColumnMappings.Add("Price", "Price");
tableMapping.ColumnMappings.Add("Description", "Description");
this._adapter.TableMappings.Add(tableMapping);
this._adapter.DeleteCommand = new System.Data.SqlServerCe.SqlCeCommand();
this._adapter.DeleteCommand.Connection = this.Connection;
this._adapter.DeleteCommand.CommandText = "DELETE FROM [Products] WHERE (([ProductId] = @p1))";
this._adapter.DeleteCommand.CommandType = System.Data.CommandType.Text;
System.Data.SqlServerCe.SqlCeParameter param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p1";
param.DbType = System.Data.DbType.Int32;
param.IsNullable = true;
param.SourceColumn = "ProductId";
param.SourceVersion = System.Data.DataRowVersion.Original;
this._adapter.DeleteCommand.Parameters.Add(param);
this._adapter.InsertCommand = new System.Data.SqlServerCe.SqlCeCommand();
this._adapter.InsertCommand.Connection = this.Connection;
this._adapter.InsertCommand.CommandText = "INSERT INTO [Products] ([ProductName], [Price], [Description]) VALUES (@p1, @p2, " +
"@p3)";
this._adapter.InsertCommand.CommandType = System.Data.CommandType.Text;
param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p1";
param.IsNullable = true;
param.SourceColumn = "ProductName";
this._adapter.InsertCommand.Parameters.Add(param);
param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p2";
param.DbType = System.Data.DbType.Currency;
param.IsNullable = true;
param.SourceColumn = "Price";
this._adapter.InsertCommand.Parameters.Add(param);
param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p3";
param.IsNullable = true;
param.SourceColumn = "Description";
this._adapter.InsertCommand.Parameters.Add(param);
this._adapter.UpdateCommand = new System.Data.SqlServerCe.SqlCeCommand();
this._adapter.UpdateCommand.Connection = this.Connection;
this._adapter.UpdateCommand.CommandText = "UPDATE [Products] SET [ProductName] = @p1, [Price] = @p2, [Description] = @p3 WHE" +
"RE (([ProductId] = @p4))";
this._adapter.UpdateCommand.CommandType = System.Data.CommandType.Text;
param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p1";
param.IsNullable = true;
param.SourceColumn = "ProductName";
this._adapter.UpdateCommand.Parameters.Add(param);
param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p2";
param.DbType = System.Data.DbType.Currency;
param.IsNullable = true;
param.SourceColumn = "Price";
this._adapter.UpdateCommand.Parameters.Add(param);
param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p3";
param.IsNullable = true;
param.SourceColumn = "Description";
this._adapter.UpdateCommand.Parameters.Add(param);
param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p4";
param.DbType = System.Data.DbType.Int32;
param.IsNullable = true;
param.SourceColumn = "ProductId";
param.SourceVersion = System.Data.DataRowVersion.Original;
this._adapter.UpdateCommand.Parameters.Add(param);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void InitConnection() {
this._connection = new System.Data.SqlServerCe.SqlCeConnection();
this._connection.ConnectionString = ("Data Source ="
+ (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\AppDatabase.sdf;"));
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void InitCommandCollection() {
this._commandCollection = new System.Data.SqlServerCe.SqlCeCommand[1];
this._commandCollection[0] = new System.Data.SqlServerCe.SqlCeCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT [ProductId], [ProductName], [Price], [Description] FROM [Products]";
this._commandCollection[0].CommandType = System.Data.CommandType.Text;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
public virtual int Fill(AppDatabaseDataSet.ProductsDataTable dataTable) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -