📄 _mydatabase_1dataset.designer.cs
字号:
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
namespace SQLserver._MyDatabase_1DataSetTableAdapters {
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.ComponentModel.DataObjectAttribute(true)]
public partial class stuTableAdapter : 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 stuTableAdapter() {
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 = "stu";
tableMapping.ColumnMappings.Add("Name", "Name");
tableMapping.ColumnMappings.Add("Age", "Age");
tableMapping.ColumnMappings.Add("NO", "NO");
this._adapter.TableMappings.Add(tableMapping);
this._adapter.InsertCommand = new System.Data.SqlServerCe.SqlCeCommand();
this._adapter.InsertCommand.Connection = this.Connection;
this._adapter.InsertCommand.CommandText = "INSERT INTO [stu] ([Name], [Age], [NO]) VALUES (@p1, @p2, @p3)";
this._adapter.InsertCommand.CommandType = System.Data.CommandType.Text;
System.Data.SqlServerCe.SqlCeParameter param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p1";
param.IsNullable = true;
param.SourceColumn = "Name";
this._adapter.InsertCommand.Parameters.Add(param);
param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p2";
param.IsNullable = true;
param.SourceColumn = "Age";
this._adapter.InsertCommand.Parameters.Add(param);
param = new System.Data.SqlServerCe.SqlCeParameter();
param.ParameterName = "@p3";
param.IsNullable = true;
param.SourceColumn = "NO";
this._adapter.InsertCommand.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) + "\\MyDatabase#1.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 [Name], [Age], [NO] FROM [stu]";
this._commandCollection[0].CommandType = System.Data.CommandType.Text;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
public virtual int Fill(_MyDatabase_1DataSet.stuDataTable dataTable) {
this.Adapter.SelectCommand = this.CommandCollection[0];
if ((this.ClearBeforeFill == true)) {
dataTable.Clear();
}
int returnValue = this.Adapter.Fill(dataTable);
return returnValue;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
public virtual _MyDatabase_1DataSet.stuDataTable GetData() {
this.Adapter.SelectCommand = this.CommandCollection[0];
_MyDatabase_1DataSet.stuDataTable dataTable = new _MyDatabase_1DataSet.stuDataTable();
this.Adapter.Fill(dataTable);
return dataTable;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public virtual int Update(_MyDatabase_1DataSet.stuDataTable dataTable) {
return this.Adapter.Update(dataTable);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public virtual int Update(_MyDatabase_1DataSet dataSet) {
return this.Adapter.Update(dataSet, "stu");
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public virtual int Update(System.Data.DataRow dataRow) {
return this.Adapter.Update(new System.Data.DataRow[] {
dataRow});
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public virtual int Update(System.Data.DataRow[] dataRows) {
return this.Adapter.Update(dataRows);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
public virtual int Insert(string p1, string p2, string p3) {
if ((p1 == null)) {
this.Adapter.InsertCommand.Parameters[0].Value = System.DBNull.Value;
}
else {
this.Adapter.InsertCommand.Parameters[0].Value = ((string)(p1));
}
if ((p2 == null)) {
this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;
}
else {
this.Adapter.InsertCommand.Parameters[1].Value = ((string)(p2));
}
if ((p3 == null)) {
this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value;
}
else {
this.Adapter.InsertCommand.Parameters[2].Value = ((string)(p3));
}
System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open)
!= System.Data.ConnectionState.Open)) {
this.Adapter.InsertCommand.Connection.Open();
}
try {
int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
return returnValue;
}
finally {
if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
this.Adapter.InsertCommand.Connection.Close();
}
}
}
}
}
namespace _MyDatabase_1DataSetUtil {
using System;
using System.Data;
public partial class DesignerUtil {
public static bool IsDesignTime() {
// Determine if this instance is running against .NET Framework by using the MSCoreLib PublicKeyToken
System.Reflection.Assembly mscorlibAssembly = typeof(int).Assembly;
if ((mscorlibAssembly != null)) {
if (mscorlibAssembly.FullName.ToUpper().EndsWith("B77A5C561934E089")) {
return true;
}
}
return false;
}
public static bool IsRunTime() {
// Determine if this instance is running against .NET Compact Framework by using the MSCoreLib PublicKeyToken
System.Reflection.Assembly mscorlibAssembly = typeof(int).Assembly;
if ((mscorlibAssembly != null)) {
if (mscorlibAssembly.FullName.ToUpper().EndsWith("969DB8053D3322AC")) {
return true;
}
}
return false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -