Zum Inhalt springen

Alabama

Mitglieder
  • Gesamte Inhalte

    1
  • Benutzer seit

  • Letzter Besuch

Alle Inhalte von Alabama

  1. Alabama

    Update in OleDb

    Hallo, ich habe folgendes Problem: Der einfache Update mit variablem Inhalt(status) erfolgt einfach nicht, doch wenn ich den update hardcodiere so wie angegeben dann funktioniert es. Auf folgende dinge habe ich schon geachtet: -Datenbank verbindung steht und Transaktionen können durchgeführt werden -Der Paramatertyp ist der selbe wie in der Datenbank -Die ApplicationOID ist in der Tabelle vorhanden -dieser hardcodierte befehl funktioniert public bool AcceptApplication(int applicationOID,int status ) { bool ok = false; try { using (OleDbConnection oConnection = new OleDbConnection(connectionString)) { using (OleDbCommand oCommand = new OleDbCommand()) { oCommand.Connection = oConnection; //status war hier der Paramter @status oCommand.CommandText = "UPDATE Termine SET Status = 3 WHERE ApplicationID = @applicationID"; oCommand.Parameters.Add("@applicationID", OleDbType.Integer).Value = applicationOID; //oCommand.Parameters.Add("@status", OleDbType.UnsignedTinyInt).Value = status; oConnection.Open(); int updateDone = oCommand.ExecuteNonQuery(); if (updateDone > 0) { ok = true; } oConnection.Close(); } } } catch (Exception ex) { System.Diagnostics.Trace.WriteLine("Error in \"AcceptApplication\": " + ex.Message); } return ok; } Es wird kein Fehler geworfen sondern der update mit Parameter angabe wird nicht getätigt, updateDone bleibt auf 0. danke schonmal im Vorraus für eure Hilfe

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...