none
Getting Database information RRS feed

  • Question

  • Hey everybody,

     

    I hope someone can help me.

    I have a database in which I can save data.

    I'm doing this using the following code:

     

    Code Snippet

    //toevoegen aan DagRapport

    DataRow DrDr = ppcDBDataSet.DagRapport.NewRow();

    fSignIn.data.DagRapportNr = Int32.Parse((DrDr["DagRapportNummer"]).ToString());

    DrDr["Datum"] = huidigeDatum;

    fSignIn.data.DagRapportDatum = huidigeDatum;

    DrDr["MonteurNr"] = fSignIn.data.MonteurNr;

    DrBeginTijd = DateTime.Now.Hour.ToString() + ":" +

    DateTime.Now.Minute.ToString() + ":" +

    DateTime.Now.Second.ToString();

    DrDr["BeginTijd"] = DrBeginTijd;

    fSignIn.data.DagRapportBeginTijd = DrBeginTijd;

    DrEindTijd = DateTime.Now.Hour.ToString() + ":" +

    DateTime.Now.Minute.ToString() + ":" +

    DateTime.Now.Second.ToString();

    DrDr["EindTijd"] = DrEindTijd;

    DrDr["BeginStandKm"] = 10;

    fSignIn.data.DagRapportBeginStandKm = Int32.Parse((DrDr["BeginStandKm"]).ToString());

    DrDr["EindStandKm"] = 11;

    ppcDBDataSet.DagRapport.Rows.Add(DrDr);

    dagRapportTableAdapter.Update(DrDr);

    ppcDBDataSet.Clear();

    dagRapportTableAdapter.Fill(ppcDBDataSet.DagRapport);

    //einde toevoegen aan DagRapport

     

    This is when I start my program, the starting time is saved in BeginTijd. Now, when I end the program, I need to get the same row I just created and filled and update the EindTijd. At the start of the program it gets the same value als BeginTijd, but when I end my program the value of EindTijd needs to be updated.

     

    Hope somebody can help

     

    Korsten

     

     

     

    Monday, June 18, 2007 12:34 PM

All replies

  • You'll need to store some reference to the row where it can be retireved.  Probably a field in the same location as the dataset (ppcDBDataSet) that stores the datarow itself would work.
    Tuesday, June 19, 2007 4:52 PM