Курсовая работа: Предметная область "тестирование"

this->dataGridView1->Location = System::Drawing::Point(12,30);

this->dataGridView1->ReadOnly=true;

this->listBox1->Visible=true;

this->listBox1->Location=System::Drawing::Point(300,30);

this->Сохранить->Enabled=false;

}

}

Участок кода , реализующий один из запросов

if (flag==7)

{

String^ connect="provider=Microsoft.Jet.OLEDB.4.0;"+path_d;

OleDbConnection^ myOleDbConnection = gcnew OleDbConnection(connect);

DataSet = gcnew System::Data::DataSet();

DataSet->CaseSensitive = true;

OleDbCommand^ myOleDbCommand = myOleDbConnection->CreateCommand();

myOleDbCommand->CommandText ="SELECT Answer.grade, Test_Question.ID_test, Test_Question.ID_question, Answer.ID_answer FROM Answer INNER JOIN (Test_Question INNER JOIN Answer_Question ON Test_Question.ID_question = Answer_Question.ID_question) ON Answer.ID_answer = Answer_Question.ID_answer WHERE (((Test_Question.ID_test)='"+this->textBox3->Text+"') AND ((Test_Question.ID_question)=[Answer_Question].[ID_question]) AND ((Answer.ID_answer)=[Answer_Question].[ID_answer]) AND ((Answer.correct)='yes'));";

myOleDbConnection->Open();

myOleDbDataAdapter = gcnew OleDbDataAdapter();

myOleDbDataAdapter->SelectCommand = myOleDbCommand;

myOleDbDataAdapter->Fill(DataSet,"Test");

dataGridView1->DataSource = DataSet ;

dataGridView1->DataMember = "Test";

this->dataGridView1->DataSource = DataSet->Tables["Test"]->DefaultView;

myOleDbConnection->Close();

table="Test";

String^ connectionString2 = "provider=Microsoft.Jet.OLEDB.4.0;"+path_a;

OleDbConnection^ myOleDbConnection2 = gcnew OleDbConnection(connectionString2);

OleDbCommand^ myOleDbCommand2 = myOleDbConnection2->CreateCommand();

myOleDbCommand2->CommandText =

К-во Просмотров: 376
Бесплатно скачать Курсовая работа: Предметная область "тестирование"