-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
a_skl
authored and
a_skl
committed
Jan 13, 2022
1 parent
9c01b4e
commit 9958bae
Showing
12 changed files
with
498 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.32002.261 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project3", "Project3\Project3.vcxproj", "{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}.Debug|Any CPU.ActiveCfg = Debug|Win32 | ||
{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}.Debug|x64.ActiveCfg = Debug|x64 | ||
{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}.Debug|x64.Build.0 = Debug|x64 | ||
{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}.Debug|x86.Build.0 = Debug|Win32 | ||
{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}.Release|Any CPU.ActiveCfg = Release|Win32 | ||
{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}.Release|x64.ActiveCfg = Release|x64 | ||
{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}.Release|x64.Build.0 = Release|x64 | ||
{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}.Release|x86.ActiveCfg = Release|Win32 | ||
{7AC62CB8-8C8B-4AD9-8D0D-7DB4B756C552}.Release|x86.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {7A7F0AF7-97B2-4897-B481-820B2B0683EA} | ||
EndGlobalSection | ||
EndGlobal |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "MyForm.h" | ||
using namespace System; | ||
using namespace System::Windows::Forms; | ||
|
||
[STAThread] | ||
int main(array<String^>^ arg) { | ||
Application::EnableVisualStyles(); | ||
Application::SetCompatibleTextRenderingDefault(false); | ||
|
||
Project3::MyForm form; | ||
Application::Run(% form); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
#pragma once | ||
|
||
namespace Project3 { | ||
|
||
using namespace System; | ||
using namespace System::ComponentModel; | ||
using namespace System::Collections; | ||
using namespace System::Windows::Forms; | ||
using namespace System::Data; | ||
using namespace System::Drawing; | ||
using namespace System::Data::Sql; | ||
using namespace System::Data::SqlClient; | ||
// using namespace System::Data::SqlClient::SqlDataReader; | ||
|
||
|
||
/// <summary> | ||
/// Ñâîäêà äëÿ MyForm | ||
/// </summary> | ||
public ref class MyForm : public System::Windows::Forms::Form | ||
{ | ||
public: | ||
MyForm(void) | ||
{ | ||
InitializeComponent(); | ||
// | ||
//TODO: äîáàâüòå êîä êîíñòðóêòîðà | ||
// | ||
} | ||
|
||
protected: | ||
/// <summary> | ||
/// Îñâîáîäèòü âñå èñïîëüçóåìûå ðåñóðñû. | ||
/// </summary> | ||
~MyForm() | ||
{ | ||
if (components) | ||
{ | ||
delete components; | ||
} | ||
} | ||
private: System::Windows::Forms::DataGridView^ dataGridView1; | ||
private: System::Windows::Forms::DataGridViewTextBoxColumn^ FriendName; | ||
private: System::Windows::Forms::Button^ Refreshbtn; | ||
protected: | ||
|
||
private: | ||
/// <summary> | ||
/// Îáÿçàòåëüíàÿ ïåðåìåííàÿ êîíñòðóêòîðà. | ||
/// </summary> | ||
System::ComponentModel::Container ^components; | ||
|
||
#pragma region Windows Form Designer generated code | ||
/// <summary> | ||
/// Òðåáóåìûé ìåòîä äëÿ ïîääåðæêè êîíñòðóêòîðà — íå èçìåíÿéòå | ||
/// ñîäåðæèìîå ýòîãî ìåòîäà ñ ïîìîùüþ ðåäàêòîðà êîäà. | ||
/// </summary> | ||
void InitializeComponent(void) | ||
{ | ||
this->dataGridView1 = (gcnew System::Windows::Forms::DataGridView()); | ||
this->FriendName = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn()); | ||
this->Refreshbtn = (gcnew System::Windows::Forms::Button()); | ||
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->dataGridView1))->BeginInit(); | ||
this->SuspendLayout(); | ||
// | ||
// dataGridView1 | ||
// | ||
this->dataGridView1->AllowUserToOrderColumns = true; | ||
this->dataGridView1->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize; | ||
this->dataGridView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(1) { this->FriendName }); | ||
this->dataGridView1->Location = System::Drawing::Point(12, -2); | ||
this->dataGridView1->Name = L"dataGridView1"; | ||
this->dataGridView1->RowHeadersWidth = 51; | ||
this->dataGridView1->RowTemplate->Height = 24; | ||
this->dataGridView1->Size = System::Drawing::Size(333, 378); | ||
this->dataGridView1->TabIndex = 0; | ||
this->dataGridView1->CellContentClick += gcnew System::Windows::Forms::DataGridViewCellEventHandler(this, &MyForm::dataGridView1_CellContentClick); | ||
// | ||
// FriendName | ||
// | ||
this->FriendName->HeaderText = L"Name"; | ||
this->FriendName->MinimumWidth = 6; | ||
this->FriendName->Name = L"FriendName"; | ||
this->FriendName->Width = 125; | ||
// | ||
// Refreshbtn | ||
// | ||
this->Refreshbtn->Location = System::Drawing::Point(1130, 323); | ||
this->Refreshbtn->Name = L"Refreshbtn"; | ||
this->Refreshbtn->Size = System::Drawing::Size(239, 53); | ||
this->Refreshbtn->TabIndex = 1; | ||
this->Refreshbtn->Text = L"Refresh"; | ||
this->Refreshbtn->UseVisualStyleBackColor = true; | ||
this->Refreshbtn->Click += gcnew System::EventHandler(this, &MyForm::Refreshbtn_Click); | ||
// | ||
// MyForm | ||
// | ||
this->AutoScaleDimensions = System::Drawing::SizeF(8, 16); | ||
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; | ||
this->ClientSize = System::Drawing::Size(1381, 377); | ||
this->Controls->Add(this->Refreshbtn); | ||
this->Controls->Add(this->dataGridView1); | ||
this->Name = L"MyForm"; | ||
this->Text = L"MyForm"; | ||
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->dataGridView1))->EndInit(); | ||
this->ResumeLayout(false); | ||
|
||
} | ||
#pragma endregion | ||
private: System::Void dataGridView1_CellContentClick(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e) { | ||
} | ||
private: System::Void Refreshbtn_Click(System::Object^ sender, System::EventArgs^ e) { | ||
SqlConnection^ SqlCon = gcnew SqlConnection(); | ||
SqlCommand^ SqlCom = gcnew SqlCommand(); | ||
DataTable^ SqlDt = gcnew DataTable(); | ||
SqlDataAdapter^ SqlDtA = gcnew SqlDataAdapter(); | ||
SqlDataReader^ SqlRd = gcnew SqlDataReader(); | ||
SqlCon->ConnectionString = "Data Source=LAPTOP-ALEX\SQLEXPRESS;Initial Catalog=PhonesFriends;Integrated Security=False"; | ||
SqlCon->Open(); | ||
SqlCom->Connection = SqlCon; | ||
SqlCom->CommandText = "SELECT FriendName FROM PhonesFriends"; | ||
SqlRd = SqlCom->ExecuteReader(); | ||
SqlDt->Load(SqlRd); | ||
dataGridView1->DataSource = SqlDt; | ||
|
||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<root> | ||
<!-- | ||
Microsoft ResX Schema | ||
Version 2.0 | ||
The primary goals of this format is to allow a simple XML format | ||
that is mostly human readable. The generation and parsing of the | ||
various data types are done through the TypeConverter classes | ||
associated with the data types. | ||
Example: | ||
... ado.net/XML headers & schema ... | ||
<resheader name="resmimetype">text/microsoft-resx</resheader> | ||
<resheader name="version">2.0</resheader> | ||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | ||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | ||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | ||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | ||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | ||
<value>[base64 mime encoded serialized .NET Framework object]</value> | ||
</data> | ||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | ||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | ||
<comment>This is a comment</comment> | ||
</data> | ||
There are any number of "resheader" rows that contain simple | ||
name/value pairs. | ||
Each data row contains a name, and value. The row also contains a | ||
type or mimetype. Type corresponds to a .NET class that support | ||
text/value conversion through the TypeConverter architecture. | ||
Classes that don't support this are serialized and stored with the | ||
mimetype set. | ||
The mimetype is used for serialized objects, and tells the | ||
ResXResourceReader how to depersist the object. This is currently not | ||
extensible. For a given mimetype the value must be set accordingly: | ||
Note - application/x-microsoft.net.object.binary.base64 is the format | ||
that the ResXResourceWriter will generate, however the reader can | ||
read any of the formats listed below. | ||
mimetype: application/x-microsoft.net.object.binary.base64 | ||
value : The object must be serialized with | ||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | ||
: and then encoded with base64 encoding. | ||
mimetype: application/x-microsoft.net.object.soap.base64 | ||
value : The object must be serialized with | ||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | ||
: and then encoded with base64 encoding. | ||
mimetype: application/x-microsoft.net.object.bytearray.base64 | ||
value : The object must be serialized into a byte array | ||
: using a System.ComponentModel.TypeConverter | ||
: and then encoded with base64 encoding. | ||
--> | ||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | ||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | ||
<xsd:element name="root" msdata:IsDataSet="true"> | ||
<xsd:complexType> | ||
<xsd:choice maxOccurs="unbounded"> | ||
<xsd:element name="metadata"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" use="required" type="xsd:string" /> | ||
<xsd:attribute name="type" type="xsd:string" /> | ||
<xsd:attribute name="mimetype" type="xsd:string" /> | ||
<xsd:attribute ref="xml:space" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="assembly"> | ||
<xsd:complexType> | ||
<xsd:attribute name="alias" type="xsd:string" /> | ||
<xsd:attribute name="name" type="xsd:string" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="data"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | ||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | ||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | ||
<xsd:attribute ref="xml:space" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="resheader"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="required" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
</xsd:choice> | ||
</xsd:complexType> | ||
</xsd:element> | ||
</xsd:schema> | ||
<resheader name="resmimetype"> | ||
<value>text/microsoft-resx</value> | ||
</resheader> | ||
<resheader name="version"> | ||
<value>2.0</value> | ||
</resheader> | ||
<resheader name="reader"> | ||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<resheader name="writer"> | ||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<metadata name="FriendName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | ||
<value>True</value> | ||
</metadata> | ||
</root> |
Oops, something went wrong.