Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Update Not Bounded Fields
Message
 
À
09/01/2003 12:17:08
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00739818
Message ID:
00739871
Vues:
33
No, Same effect.
Maybe I have a misstake with the way I add the new record, see this when I click "Add" button:

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
pbbolAddNew = True

myDA.InsertCommand = myCB.GetInsertCommand

With BindingContext(myDS, "Company")
.AddNew()
.Position = .Count
cbSelect.SelectedIndex = .Count - 1
End With
End Sub

Then I'll be in the window form to type in the data, then click the "Save" button which take the effect I mentioned down.

Does this way effect my problem ?


>Yes, just try what I suggested and see if it takes care of your problem ...
>
>
>
>>Bonnie,
>>Keep in mind this is not an exsisting row, I am adding it as new.
>>
>>
>>>Yes, you can do that ... you must have some other problem that's preventing that column from updating. Actually, I've had problems using the EndCurrentEdit() and you might want to try using the DataRow's EndEdit() instead, like this:
>>>
>>>
>>>public void EndTheEdit(DataSet ds)
>>>{
>>>  if (ds == null)
>>>    return;
>>>
>>>  for (int nTable = 0; nTable < ds.Tables.Count; nTable++)
>>>  {
>>>    for (int nRow = 0; nRow < ds.Tables[nTable].Rows.Count; nRow++)
>>>    {
>>>      if (ds.Tables[nTable].Rows[nRow].HasVersion(DataRowVersion.Proposed))
>>>        ds.Tables[nTable].Rows[nRow].EndEdit();
>>>    }
>>>  }
>>>}
>>>
>>>
>>>~~Bonnie
>>>
>>>
>>>>No, same problem.
>>>>What I want to say, is it possible that I can update my DataSet using Databinding to some fields & Manual update to other fields (same time)?
>>>>
>>>>
>>>>>OK, I don't use the CommandBuilder stuff (I roll my own), but I think your problem is that you should do the EndCurrentEdit() before you build the Insert command.
>>>>>
>>>>>~~Bonnie
>>>>>
>>>>>
>>>>>>I am updating my DataSet using the DataRow, my case as follow:
>>>>>>When I click "Add" button to add new record to the table all the files are binded so I need to type in the data in the txt files in my window form
>>>>>>now, I have some flag fields not binded to any textbox in the form and must set a value to it manualy so I use this code:
>>>>>>
>>>>>>myDR("CompanyID") = strCompanyID
>>>>>>myDA.InsertCommand = myCB.GetInsertCommand
>>>>>>Me.BindingContext(myDS, "Company").EndCurrentEdit()
>>>>>>myDA.Update(myDS, "Company")
>>>>>>myDS.AcceptChanges()
>>>>>>
>>>>>>all the data saved because of the databinding except "CompanyID"
>>>>>>
>>>>>>any idea?
>>>>>>
>>>>>>
>>>>>>>Ahmad,
>>>>>>>
>>>>>>>When you say "update", do you mean change the value of a column in a DataSet.Table or do you mean update the backend database table?
>>>>>>>
>>>>>>>First one, just set your column equal to whatever:
>>>>>>>
>>>>>>>ds.Tables[0].Rows["WhateverColumn"] = "Whatever"
>>>>>>>
>>>>>>>
>>>>>>>Second one, when you update your backend database, any changed values in the DataSet will be sent to the backend.
>>>>>>>
>>>>>>>Hope this answers your question ...
>>>>>>>
>>>>>>>~~Bonnie
>>>>>>>
>>>>>>>>Hi All,
>>>>>>>>
>>>>>>>>Is there a way to update a column(s) in the table not binded, while other columns in the same table are binded?
>>>>>>>>
>>>>>>>>BR
<><><><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><><><>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform