Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

some ppl said that we can update the database with dataview directly, so I typed the follwoing codes:

Dim dv as new dataview
Dim olddv as new dataview

olddv = session("dv")    ' which I have update it and sort it in other procedure and add it in session

for i = 0 to olddv.count-1
  dv.AllowEdit = True
  dv(i).BeginEdit
  dv(i)("FirstName") = olddv(i)("FirstName")
  dv(i)("LastName") = olddv(i)("LastName")
  dv(i).EndEdit
next

But after running, although no error message it gives no change to database. All updated still appear in session only. Have I type anything wrong? Or I have misunderstand the concept?

Thank you.

Posted
Using the commandbuilder automatically generates SQL code (usually bloated) for you. You'll have greater control if you set your INSERT, UPDATE and DELETE commands manually. In any case, you would have to call DataAdapter.Update(...) as mentioned by Plaus.
Posted
Using the commandbuilder automatically generates SQL code (usually bloated) for you. You'll have greater control if you set your INSERT' date=' UPDATE and DELETE commands manually. In any case, you would have to call DataAdapter.Update(...) as mentioned by Plaus.[/quote']

Well... I am newbie for ASP.NET (obviously). Do you mean that using commandbuilder is a better approach or vice versa? Which way give a better performance in access speed and security? Thanks.

Posted
I don't use commandbuilder in prod code because I usually don't like the SQL code it produces (and besides, I don't think it works w/ stored procs). I find more control and efficiency in manually setting the SQL commands.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...