Marina
Thu Feb 02 14:01:25 CST 2006
Thank you!
"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:OpUU3EBKGHA.3200@tk2msftngp13.phx.gbl...
> Hi Marina,
>
> Congrats on new shiny MVP title!
>
> --
> Miha Markic [MVP C#]
> RightHand .NET consulting & development www.rthand.com
> Blog:
http://cs.rthand.com/blogs/blog_with_righthand/
>
> "Marina Levit [MVP]" <someone@nospam.com> wrote in message
> news:OVV$u5AKGHA.3352@TK2MSFTNGP12.phx.gbl...
>>I am guessing you have some auto increment field or something. The first
>>Update calls adds the row and populates the field - but not in your
>>dataset. You need to make sure you get the correct value in there also, in
>>this case. Or just use GUID's, which is what I prefer since you can just
>>assign the value in the client program.
>>
>> Additionally, I don't really see the point in inserting a new row, just
>> to immediately make a change to it and run an update? Why not finish
>> setting all the fields, and then call Update to insert it. Save yoruself
>> a trip to the database server.
>>
>> "latin & geek via DotNetMonster.com" <u16975@uwe> wrote in message
>> news:5b4581b59c493@uwe...
>>> hi.
>>> im at wits end! my update command isnt working properly. im able to edit
>>> and
>>> delete data successfully with the same command builder, but when i add a
>>> new
>>> row and update, i get an "affected zero records" message.
>>>
>>>
>>> Dim cb2 As New OleDb.OleDbCommandBuilder(da2)
>>> dv.AllowNew = False
>>> gnrow = ds.Tables("exp").NewRow()
>>> ds.Tables("exp").Rows.Add(gnrow)
>>> da2.Update(ds, "exp")
>>> max1 = ds.Tables("exp").Rows.Count
>>> 'assigning the new record to the open employee record
>>> ds.Tables("exp").Rows(max1 - 1).Item("emp") = wonly1
>>> da2.Update(ds, ------------------>
>>> this is where the program seizes up.
>>>
>>>
>>> will someone please tell me what to do to fix it?
>>>
>>> --
>>> it's all latin & geek to me! ;-)
>>>
>>> Message posted via
http://www.dotnetmonster.com
>>
>>
>
>