📄 customers.h
字号:
}
inline System::Void Customers::CustomersRow::SetFaxNull() {
this[this->tableCustomers->FaxColumn] = System::Convert::DBNull;
}
inline Customers::CustomersRowChangeEvent::CustomersRowChangeEvent(Ex22_03::Customers::CustomersRow^ row, System::Data::DataRowAction action) {
this->eventRow = row;
this->eventAction = action;
}
inline Ex22_03::Customers::CustomersRow^ Customers::CustomersRowChangeEvent::Row::get() {
return this->eventRow;
}
inline System::Data::DataRowAction Customers::CustomersRowChangeEvent::Action::get() {
return this->eventAction;
}
}
namespace Ex22_03 {
namespace CustomersTableAdapters {
using namespace System;
ref class CustomersTableAdapter;
[System::CodeDom::Compiler::GeneratedCodeAttribute(L"System.Data.Design.TypedDataSetGenerator", L"2.0.0.0"),
System::ComponentModel::DesignerCategoryAttribute(L"code"),
System::ComponentModel::ToolboxItem(true),
System::ComponentModel::DataObjectAttribute(true),
System::ComponentModel::DesignerAttribute(L"Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner"
L", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"),
System::ComponentModel::Design::HelpKeywordAttribute(L"vs.data.TableAdapter")]
public ref class CustomersTableAdapter : public System::ComponentModel::Component {
private: System::Data::Odbc::OdbcDataAdapter^ _adapter;
private: System::Data::Odbc::OdbcConnection^ _connection;
private: cli::array< System::Data::Odbc::OdbcCommand^ >^ _commandCollection;
private: System::Boolean _clearBeforeFill;
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
CustomersTableAdapter();
private: [System::Diagnostics::DebuggerNonUserCodeAttribute]
property System::Data::Odbc::OdbcDataAdapter^ Adapter {
System::Data::Odbc::OdbcDataAdapter^ get();
}
internal: [System::Diagnostics::DebuggerNonUserCodeAttribute]
property System::Data::Odbc::OdbcConnection^ Connection {
System::Data::Odbc::OdbcConnection^ get();
System::Void set(System::Data::Odbc::OdbcConnection^ value);
}
protected: [System::Diagnostics::DebuggerNonUserCodeAttribute]
property cli::array< System::Data::Odbc::OdbcCommand^ >^ CommandCollection {
cli::array< System::Data::Odbc::OdbcCommand^ >^ get();
}
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
property System::Boolean ClearBeforeFill {
System::Boolean get();
System::Void set(System::Boolean value);
}
private: [System::Diagnostics::DebuggerNonUserCodeAttribute]
System::Void InitAdapter();
private: [System::Diagnostics::DebuggerNonUserCodeAttribute]
System::Void InitConnection();
private: [System::Diagnostics::DebuggerNonUserCodeAttribute]
System::Void InitCommandCollection();
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
[System::ComponentModel::Design::HelpKeywordAttribute(L"vs.data.TableAdapter")]
[System::ComponentModel::DataObjectMethodAttribute(System::ComponentModel::DataObjectMethodType::Fill, true)]
virtual System::Int32 Fill(Ex22_03::Customers::CustomersDataTable^ dataTable);
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
[System::ComponentModel::Design::HelpKeywordAttribute(L"vs.data.TableAdapter")]
[System::ComponentModel::DataObjectMethodAttribute(System::ComponentModel::DataObjectMethodType::Select, true)]
virtual Ex22_03::Customers::CustomersDataTable^ GetData();
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
[System::ComponentModel::Design::HelpKeywordAttribute(L"vs.data.TableAdapter")]
virtual System::Int32 Update(Ex22_03::Customers::CustomersDataTable^ dataTable);
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
[System::ComponentModel::Design::HelpKeywordAttribute(L"vs.data.TableAdapter")]
virtual System::Int32 Update(Ex22_03::Customers^ dataSet);
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
[System::ComponentModel::Design::HelpKeywordAttribute(L"vs.data.TableAdapter")]
virtual System::Int32 Update(System::Data::DataRow^ dataRow);
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
[System::ComponentModel::Design::HelpKeywordAttribute(L"vs.data.TableAdapter")]
virtual System::Int32 Update(cli::array< System::Data::DataRow^ >^ dataRows);
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
[System::ComponentModel::Design::HelpKeywordAttribute(L"vs.data.TableAdapter")]
[System::ComponentModel::DataObjectMethodAttribute(System::ComponentModel::DataObjectMethodType::Delete, true)]
virtual System::Int32 Delete(
System::String^ Original_CustomerID,
System::String^ Original_CompanyName,
System::String^ Original_ContactName,
System::String^ Original_ContactTitle,
System::String^ Original_Address,
System::String^ Original_City,
System::String^ Original_Region,
System::String^ Original_PostalCode,
System::String^ Original_Country,
System::String^ Original_Phone,
System::String^ Original_Fax);
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
[System::ComponentModel::Design::HelpKeywordAttribute(L"vs.data.TableAdapter")]
[System::ComponentModel::DataObjectMethodAttribute(System::ComponentModel::DataObjectMethodType::Insert, true)]
virtual System::Int32 Insert(
System::String^ CustomerID,
System::String^ CompanyName,
System::String^ ContactName,
System::String^ ContactTitle,
System::String^ Address,
System::String^ City,
System::String^ Region,
System::String^ PostalCode,
System::String^ Country,
System::String^ Phone,
System::String^ Fax);
public: [System::Diagnostics::DebuggerNonUserCodeAttribute]
[System::ComponentModel::Design::HelpKeywordAttribute(L"vs.data.TableAdapter")]
[System::ComponentModel::DataObjectMethodAttribute(System::ComponentModel::DataObjectMethodType::Update, true)]
virtual System::Int32 Update(
System::String^ CustomerID,
System::String^ CompanyName,
System::String^ ContactName,
System::String^ ContactTitle,
System::String^ Address,
System::String^ City,
System::String^ Region,
System::String^ PostalCode,
System::String^ Country,
System::String^ Phone,
System::String^ Fax,
System::String^ Original_CustomerID,
System::String^ Original_CompanyName,
System::String^ Original_ContactName,
System::String^ Original_ContactTitle,
System::String^ Original_Address,
System::String^ Original_City,
System::String^ Original_Region,
System::String^ Original_PostalCode,
System::String^ Original_Country,
System::String^ Original_Phone,
System::String^ Original_Fax);
};
}
}
namespace Ex22_03 {
namespace CustomersTableAdapters {
inline CustomersTableAdapter::CustomersTableAdapter() {
this->ClearBeforeFill = true;
}
inline System::Data::Odbc::OdbcDataAdapter^ CustomersTableAdapter::Adapter::get() {
if (this->_adapter == nullptr) {
this->InitAdapter();
}
return this->_adapter;
}
inline System::Data::Odbc::OdbcConnection^ CustomersTableAdapter::Connection::get() {
if (this->_connection == nullptr) {
this->InitConnection();
}
return this->_connection;
}
inline System::Void CustomersTableAdapter::Connection::set(System::Data::Odbc::OdbcConnection^ value) {
this->_connection = __identifier(value);
if (this->Adapter->InsertCommand != nullptr) {
this->Adapter->InsertCommand->Connection = __identifier(value);
}
if (this->Adapter->DeleteCommand != nullptr) {
this->Adapter->DeleteCommand->Connection = __identifier(value);
}
if (this->Adapter->UpdateCommand != nullptr) {
this->Adapter->UpdateCommand->Connection = __identifier(value);
}
for ( System::Int32 i = 0; (i < this->CommandCollection->Length); i = (i + 1)) {
if (this->CommandCollection[i] != nullptr) {
(cli::safe_cast<System::Data::Odbc::OdbcCommand^ >(this->CommandCollection[i]))->Connection = __identifier(value);
}
}
}
inline cli::array< System::Data::Odbc::OdbcCommand^ >^ CustomersTableAdapter::CommandCollection::get() {
if (this->_commandCollection == nullptr) {
this->InitCommandCollection();
}
return this->_commandCollection;
}
inline System::Boolean CustomersTableAdapter::ClearBeforeFill::get() {
return this->_clearBeforeFill;
}
inline System::Void CustomersTableAdapter::ClearBeforeFill::set(System::Boolean value) {
this->_clearBeforeFill = __identifier(value);
}
inline System::Void CustomersTableAdapter::InitAdapter() {
this->_adapter = (gcnew System::Data::Odbc::OdbcDataAdapter());
System::Data::Common::DataTableMapping^ tableMapping = (gcnew System::Data::Common::DataTableMapping());
tableMapping->SourceTable = L"Table";
tableMapping->DataSetTable = L"Customers";
tableMapping->ColumnMappings->Add(L"CustomerID", L"CustomerID");
tableMapping->ColumnMappings->Add(L"CompanyName", L"CompanyName");
tableMapping->ColumnMappings->Add(L"ContactName", L"ContactName");
tableMapping->ColumnMappings->Add(L"ContactTitle", L"ContactTitle");
tableMapping->ColumnMappings->Add(L"Address", L"Address");
tableMapping->ColumnMappings->Add(L"City", L"City");
tableMapping->ColumnMappings->Add(L"Region", L"Region");
tableMapping->ColumnMappings->Add(L"PostalCode", L"PostalCode");
tableMapping->ColumnMappings->Add(L"Country", L"Country");
tableMapping->ColumnMappings->Add(L"Phone", L"Phone");
tableMapping->ColumnMappings->Add(L"Fax", L"Fax");
this->_adapter->TableMappings->Add(tableMapping);
this->_adapter->DeleteCommand = (gcnew System::Data::Odbc::OdbcCommand());
this->_adapter->DeleteCommand->Connection = this->Connection;
this->_adapter->DeleteCommand->CommandText = L"DELETE FROM [Customers] WHERE (([CustomerID] = \?) AND ((\? = 1 AND [CompanyName] I"
L"S NULL) OR ([CompanyName] = \?)) AND ((\? = 1 AND [ContactName] IS NULL) OR ([Cont"
L"actName] = \?)) AND ((\? = 1 AND [ContactTitle] IS NULL) OR ([ContactTitle] = \?)) "
L"AND ((\? = 1 AND [Address] IS NULL) OR ([Address] = \?)) AND ((\? = 1 AND [City] IS"
L" NULL) OR ([City] = \?)) AND ((\? = 1 AND [Region] IS NULL) OR ([Region] = \?)) AND"
L" ((\? = 1 AND [PostalCode] IS NULL) OR ([PostalCode] = \?)) AND ((\? = 1 AND [Count"
L"ry] IS NULL) OR ([Country] = \?)) AND ((\? = 1 AND [Phone] IS NULL) OR ([Phone] = "
L"\?)) AND ((\? = 1 AND [Fax] IS NULL) OR ([Fax] = \?)))";
this->_adapter->DeleteCommand->CommandType = System::Data::CommandType::Text;
this->_adapter->DeleteCommand->Parameters->Add((gcnew System::Data::Odbc::OdbcParameter(L"Original_CustomerID", System::Data::Odbc::OdbcType::NVarChar,
0, System::Data::ParameterDirection::Input, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"CustomerID",
System::Data::DataRowVersion::Original, false, nullptr)));
this->_adapter->DeleteCommand->Parameters->Add((gcnew System::Data::Odbc::OdbcParameter(L"IsNull_CompanyName", System::Data::Odbc::OdbcType::Int,
0, System::Data::ParameterDirection::Input, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"CompanyName",
System::Data::DataRowVersion::Original, true, nullptr)));
this->_adapter->DeleteCommand->Parameters->Add((gcnew System::Data::Odbc::OdbcParameter(L"Original_CompanyName", System::Data::Odbc::OdbcType::NVarChar,
0, System::Data::ParameterDirection::Input, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"CompanyName",
System::Data::DataRowVersion::Original, false, nullptr)));
this->_adapter->DeleteCommand->Parameters->Add((gcnew System::Data::Odbc::OdbcParameter(L"IsNull_ContactName", System::Data::Odbc::OdbcType::Int,
0, System::Data::ParameterDirection::Input, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"ContactName",
System::Data::DataRowVersion::Original, true, nullptr)));
this->_adapter->DeleteCommand->Parameters->Add((gcnew System::Data::Odbc::OdbcParameter(L"Original_ContactName", System::Data::Odbc::OdbcType::NVarChar,
0, System::Data::ParameterDirection::Input, static_cast<System::Byte>(0), static_cast<System::Byte>(0), L"ContactName",
System::Data::DataRowVersion::Original, false, nullptr)));
this->_adapter->DeleteCommand->Parameters->Add((gcnew System::Data::Odbc::Od
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -