السلام عليكم
ظهور خطأ Index was outside the bounds of the array. عند تنفيز هذه الجملة
label17.Text = Publics.CurrentBookAutonumber;
string S_connetionString2 = null;
OleDbConnection S_cnn2;
OleDbCommand S_cmd2;
string S_sql2 = null;
OleDbDataReader S_reader2;
S_connetionString2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..//..//S_libdata.mdb;";
S_sql2 = "SELECT COUNT(*)FROM bookd WHERE (bookdautonumber = (" + label17.Text + "))";
S_cnn2 = new OleDbConnection(S_connetionString2);
try
{
S_cnn2.Open();
S_cmd2 = new OleDbCommand(S_sql2, S_cnn2);
S_reader2 = S_cmd2.ExecuteReader();
while (S_reader2.Read())
{
bookdnameTextBox.Text = ("" + S_reader2.GetValue(1));
bookdbarcodeTextBox.Text = ("" + S_reader2.GetValue(2));
bookdsectionComboBox.Text = ("" + S_reader2.GetValue(3));
bookdauthorTextBox.Text = ("" + S_reader2.GetValue(4));
bookdeditionnoTextBox.Text = ("" + S_reader2.GetValue(5));
bookddepositnoTextBox.Text = ("" + S_reader2.GetValue(6));
bookdinternationalnoTextBox.Text = ("" + S_reader2.GetValue(7));
bookdjoindateTextBox.Text = ("" + S_reader2.GetValue(8));
bookdlocationaComboBox.Text = ("" + S_reader2.GetValue(9));
bookdlocationbComboBox.Text = ("" + S_reader2.GetValue(10));
bookdlocationcComboBox.Text = ("" + S_reader2.GetValue(11));
bookdstateTextBox.Text = ("" + S_reader2.GetValue(12));
bookdcontentTextBox.Text = ("" + S_reader2.GetValue(13));
bookdrecordernameTextBox.Text = ("" + S_reader2.GetValue(14));
}
S_reader2.Close();
S_cmd2.Dispose();
S_cnn2.Close();
return;
}
catch (Exception ex)
{
MessageBox.Show("غير قادر علي فتح الأتصال ! ");
}