Курсовая работа: Телефонная компания
rdr=cmd->ExecuteReader();
rdr->Close();
}
if(ChoiseToLV2==5)
{
String ^q="insert into services (Opisanie,Stoimost)VALUES('"+this->textBox10->Text+"',"+Convert::ToInt32(this->textBox11->Text)+")";
cmd=gcnew System::Data::OleDb::OleDbCommand(q,cn);
rdr=cmd->ExecuteReader();
rdr->Close();
q="insert into changes(id_user,data,Opisanie) values("+id+",Now(),'Добавлениезаписивтаблицууслуги');";
cmd=gcnew System::Data::OleDb::OleDbCommand(q,cn);
rdr=cmd->ExecuteReader();
rdr->Close();
}
rdr->Close();
cn->Close();
}
//Действия, происходящие при внесении данных в поле ввода номера
private: System::Void comboBox2_TextUpdate(System::Object^ sender, System::EventArgs^ e) {
cn->Open();
String ^q="SELECT surname FROM Klient WHERE num like '"+this->comboBox2->Text+"%';";
System::Data::OleDb::OleDbCommand^cmd=gcnew System::Data::OleDb::OleDbCommand(q,cn);
System::Data::OleDb::OleDbDataReader ^rdr=cmd->ExecuteReader();
while(rdr->Read())
{
this->comboBox1->Text=Convert::ToString(rdr[0]);
}
rdr->Close();
cn->Close();