Hi Jan,
Please look at your code that you entered from page 337. The following line doesn't appear to have been executing:
Dim dsOrder as DataSet = OrderObj.GetOrderByOrderID(OrderID)
If all the code in this section appears correct, then I would trace through the program in the debugger to look at the GetDataSet method and the SaveDataSet method in the Data.vb file. The select statement is saved in the GetDataSet method and is store in the DataSet's DataAdapter. Then in the SaveDataSet method, the select statement is then used to figure out by the CommandBuilder how to create the Delete/Update/Insert statements.
>Hello,
>
>I have been following through the examples in the book, and am running into a problem with one of the VB.Net examples on page 341 - adding code to the Update button of the Order Edit Web page.
>
>I entered the code as shown, and it compiled without error. However, when executing the example, the following error occurs when pressing the "Update" button:
>
>The DataAdapter.SelectCommand property needs to be initialized.
>Source Error: Line 79 in data.vb
>The line is: DataAdapter.DeleteCommand = CommandBuilder.GetDeleteCommand()
>
>All the examples up to this point have worked, and since there are no compilation errors, I'm not sure what the problem is. No example code exists for Chapter 10 to compare.
>
>Help please.
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi