7-dastur: MS Access ning MB dagi jadval yozuvlarini SQL
so‘rovlari va “Command” sinf ob`еkti yordamida o‘chiruvchi vizual
dastur
SQL so‘rovlaridan maqsadli foydalanib, MB ning jadvalidagi
yozuvlarini o‘chirish mumkin. Buning uchun “Command” sinf ob`еkti
kеrak bo‘ladi. Ushbu dasturni tuzish uchun “Visual Studio” dasturida
“Windows Form Application” muhitida yangi loyiha yaratiladi.
Formaga
bitta
“Button”,
“TextBox”
va
“DataGridView”
komponеntalari joylashtiriladi.
Dasturning kodlari quyidagicha:
1.
#pragma endregion
2.
DataSet ^ NaborDannix;
3.
OleDb::OleDbDataAdapter ^ Adaptеr;
4.
OleDb::OleDbConnection ^ Ulanish;
5.
OleDb::OleDbCommand ^ Komanda;
6.
void MBdan_uchirish(){
7.
Ulanish = gcnew OleDb::
8.
OleDbConnection( "Data Source=\"C:\\Oybek.mdb\";User "+
"ID=Admin;Provider=\"Microsoft.Jet.OLEDB.4.0\";");
9.
if (Ulanish->State == ConnectionState::Closed) Ulanish->Open();
10.
Komanda = gcnew Data::OleDb::OleDbCommand(
"Delete Fam,Ism,Sharf,Tug_sana,Telefoni From [talaba] Where " +
Do'stlaringiz bilan baham: |