Hallo zusammen
Ich versuche jetzt schon die ganze Zeit ein bindingNavigator zum laufen zu bringen leider komme ich nicht voran.
Die Online-Hilfen bringen mir hier auch nichts.
Wenn ich das Steuerelement "BindingNavigator" einfüge kann ich nicht die BindingSource auswählen, es steht nur "(none)".
Ich habe aber eine private Variable BindingSource festgelegt:
private BindingSource bindingSource1 = new BindingSource();
und unter Form_Load:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
| private void Form1_Load(object sender, EventArgs e) { String connection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=Nordwind.mdb;"; String SQL = "SELECT PersonalNr, Nachname, Vorname, Position, Foto FROM Personal"; OleDbConnection conn = new OleDbConnection(connection); OleDbDataAdapter da = new OleDbDataAdapter(); da = new OleDbDataAdapter(SQL, connection);
try { dt = new DataTable("Personalliste"); conn.Open(); da.Fill(dt); conn.Close();
bindingSource1.DataSource = dt;
bindingNavigator1.BindingSource = bindingSource1;
textBox1.DataBindings.Add("Text", bindingSource1, "PersonalNr"); textBox2.DataBindings.Add("Text", bindingSource1, "Nachname"); textBox3.DataBindings.Add("Text", bindingSource1, "Vorname"); textBox4.DataBindings.Add("Text", bindingSource1, "Position"); showFoto(); bindingSource1.PositionChanged += new EventHandler(this.cm_PositionChanged); } catch (Exception x) { MessageBox.Show(x.Message); } } |
Ich bekomme jedesmal die Fehlermeldung der Catch-Anweisung:
"Fehler E_FAIL(0x80004005) in IErrorInfo.GetDesciption."
Ich freue mich auf eure Antworten
Lg blumione