I am using a strongly typed dataset and have filled the table adapter like so:
giving me tblOrder table in my dataset with no records (since none will have OrderUID < 0).
I'm using the following SQL stored proc (Order__Insert) for inserting a record:
Now I want to add a record into tblOrder so I do this:
I get an error saying
Code:
Me.TblOrderTableAdapter.Fill(Me.DS_OrderLookup.tblOrder, "OrderUID < 0")
I'm using the following SQL stored proc (Order__Insert) for inserting a record:
Code:
ALTER PROCEDURE dbo.Order__Insert
(
@OrderNumber int,
@OrderTypeUID int,
@ManufacturerUID int,
@SoldTo int,
@Company nvarchar(30),
@ShipTo int,
@Attention nvarchar(20)
)
AS
SET NOCOUNT OFF;
INSERT INTO [tblOrder] ([OrderNumber], [OrderTypeUID], [ManufacturerUID], [SoldTo], [Company], [ShipTo], [Attention]) VALUES (@OrderNumber, @OrderTypeUID, @ManufacturerUID, @SoldTo, @Company, @ShipTo, @Attention);
SELECT OrderUID, OrderNumber, OrderTypeUID, ManufacturerUID, SoldTo, Company, ShipTo, Attention FROM tblOrder WHERE (OrderUID = @@SCOPE_IDENTITY)
Code:
Dim r1 As DS_OrderLookup.tblOrderRow
r1 = Me.DS_OrderLookup.tblOrder.NewtblOrderRow 'add a new blank row
With r1
.OrderUID = 0
.OrderNumber = iNextNo
.OrderDate = Now()
.Company = "ABC Corporation"
End With
Me.DS_OrderLookup.tblOrder.AddtblOrderRow(r1)
Dim x As Int16 = Me.TblOrderTableAdapter.Update(Me.DS_OrderLookup.tblOrder)
Can anyone please help me with this? Thanks!Procedure or function 'Order__Insert' expects parameter '@OrderNumber', which was not supplied