Skip to content

Commit

Permalink
Final Edition
Browse files Browse the repository at this point in the history
  • Loading branch information
a_skl authored and a_skl committed Jan 21, 2022
1 parent bb5fa4a commit c2ef822
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 18 deletions.
Binary file added Project3/Interop/Interop.OleDbSrc.1.0.dll
Binary file not shown.
Binary file added Project3/Interop/Interop.TxDerived.1.0.dll
Binary file not shown.
Binary file added Project3/Interop/Interop.TxLookup.1.0.dll
Binary file not shown.
16 changes: 6 additions & 10 deletions Project3/MyForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace Project3 {
this->dataGridView1->Name = L"dataGridView1";
this->dataGridView1->RowHeadersWidth = 51;
this->dataGridView1->RowTemplate->Height = 24;
this->dataGridView1->Size = System::Drawing::Size(294, 124);
this->dataGridView1->Size = System::Drawing::Size(677, 263);
this->dataGridView1->TabIndex = 0;
this->dataGridView1->CellContentClick += gcnew System::Windows::Forms::DataGridViewCellEventHandler(this, &MyForm::dataGridView1_CellContentClick);
//
Expand All @@ -102,11 +102,11 @@ namespace Project3 {
this->dataGridView2->AllowUserToOrderColumns = true;
this->dataGridView2->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
this->dataGridView2->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(1) { this->Phones });
this->dataGridView2->Location = System::Drawing::Point(383, -2);
this->dataGridView2->Location = System::Drawing::Point(695, -2);
this->dataGridView2->Name = L"dataGridView2";
this->dataGridView2->RowHeadersWidth = 51;
this->dataGridView2->RowTemplate->Height = 24;
this->dataGridView2->Size = System::Drawing::Size(284, 124);
this->dataGridView2->Size = System::Drawing::Size(674, 263);
this->dataGridView2->TabIndex = 2;
//
// Phones
Expand All @@ -125,7 +125,7 @@ namespace Project3 {
this->Controls->Add(this->Refreshbtn);
this->Controls->Add(this->dataGridView1);
this->Name = L"MyForm";
this->Text = L"MyForm";
this->Text = L"Phonebook";
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->dataGridView1))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->dataGridView2))->EndInit();
this->ResumeLayout(false);
Expand All @@ -135,19 +135,15 @@ namespace Project3 {
private: System::Void dataGridView1_CellContentClick(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e) {
}
private: System::Void Refreshbtn_Click(System::Object^ sender, System::EventArgs^ e) {
//loadDb();

SqlConnection^ conn;
SqlConnectionStringBuilder^ connStrifBuilder;
SqlConnection^ SqlCon = gcnew SqlConnection();
SqlCommand^ SqlCom = gcnew SqlCommand();
DataTable^ SqlDt = gcnew DataTable();
SqlDataAdapter^ SqlDtA = gcnew SqlDataAdapter();
SqlDataReader^ SqlRd;
SqlCon->ConnectionString = "Data Source= 127.0.0.1;Initial Catalog=dbo.PhonesFriends;Integrated Security=true; Server = localhost";
connStrifBuilder = gcnew SqlConnectionStringBuilder();
connStrifBuilder->DataSource = "LAPTOP-8IOTANJP\\SQLEXPRESS";
connStrifBuilder->InitialCatalog = "FriendsPhones";
connStrifBuilder->IntegratedSecurity = true;
SqlCon->ConnectionString = "Data Source=127.0.0.1/SQLEXPRESS;Initial Catalog=PhonesFriends;Integrated Security=True";
SqlCon->Open();
SqlCom->Connection = SqlCon;
SqlCom->CommandText = "SELECT FriendName FROM FriendNames";
Expand Down
6 changes: 6 additions & 0 deletions Project3/MyForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@
<metadata name="FriendName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="FriendName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Phones.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Phones.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand Down
29 changes: 27 additions & 2 deletions Project3/Project3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="loadDb.cpp" />
<ClCompile Include="MyForm.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="loadDb.h" />
<ClInclude Include="MyForm.h">
<FileType>CppForm</FileType>
</ClInclude>
Expand Down Expand Up @@ -171,6 +169,33 @@
<Isolated>false</Isolated>
<EmbedInteropTypes>true</EmbedInteropTypes>
</COMReference>
<COMReference Include="TxDerived.1.0">
<VersionMinor>0</VersionMinor>
<VersionMajor>1</VersionMajor>
<Guid>342434f2-7398-425d-be08-fdc2011ef0fc</Guid>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>false</Isolated>
<EmbedInteropTypes>true</EmbedInteropTypes>
</COMReference>
<COMReference Include="OleDbSrc.1.0">
<VersionMinor>0</VersionMinor>
<VersionMajor>1</VersionMajor>
<Guid>82edf860-1f3e-426f-9dfe-959dfdb8a9e7</Guid>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>false</Isolated>
<EmbedInteropTypes>true</EmbedInteropTypes>
</COMReference>
<COMReference Include="TxLookup.1.0">
<VersionMinor>0</VersionMinor>
<VersionMajor>1</VersionMajor>
<Guid>09399b0a-c29a-4ffe-af70-828e78a16d60</Guid>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>false</Isolated>
<EmbedInteropTypes>true</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
6 changes: 0 additions & 6 deletions Project3/Project3.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@
<ClCompile Include="MyForm.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
<ClCompile Include="loadDb.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="MyForm.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
<ClInclude Include="loadDb.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
</ItemGroup>
</Project>

0 comments on commit c2ef822

Please sign in to comment.