Update Requires a valid insertcommand when passed datarow collection with new rows

R

Roy

Hi All,
I have a Janus DataGrid(Dot Net) that is bound to a typed dataset. The
dataset is empty. The grid adds rows to the dataset.
When I start to record, I find the "request number and create a datarow and
update the datarow with the request number value:

lblRequest.Text = "New Request number is: " & iSar

Dim dr As dsSupply.SupplyOrderRow

Dim i As Integer = 0

Do

ds.SupplyOrder.Rows(i).Item(0) = iSar

dr = ds.SupplyOrder(i)

dr.RequestNumberPK = iSar

i += 1

Loop Until i = ds.SupplyOrder.Rows.Count

Then I record as follows:

Try

daSupply.Update(ds.SupplyOrder)

Catch ex As Exception

MessageBox.Show(ex.Message, "Insert Order",
MessageBoxButtons.OK)

End Try

I get the following error:

Update Requires a valid insertcommand when passed datarow collection with
new rows

The dataadaptor has a sproc that does the insert. When I call the sproc and
pass the p[arams it all works fine.

Anyone have an idea why it will not work through ADo.NET?

Thanks in advance,

Roy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top