我正在尝试执行我的服务订单,这是在输入一些信息后直接到下一页可以选择技术人员。我尝试请求querystring = service orderID,所以我可以将techicianID插入表中。如何从数据库中读取服务orderID,然后传入查询字符串?
Response.Redirect(“〜/ AddEditServiceOrder / AssignService.aspx?id =”& serviceid)
答案 0 :(得分:0)
从Microsoft的这篇文章开始:How to: Create and Execute an SQL Statement that Returns Rows
答案 1 :(得分:0)
您的SQL可能看起来像这样(带有必要的声明)
INSERT INTO Orders
(VendorID, [Date], Subtotal, Discount, Freight, Total, CupCost)
VALUES (@VendorID,@Date,@Subtotal,@Discount,@Freight,@Total, @CupCost);
SELECT SCOPE_IDENTITY();
然后在VB代码中
Dim itgOrderID As Integer = CInt(cmd.ExecuteScalar)
这将为您提供新插入的服务订单的主键,以便您可以找到它并使用技术人员ID进行更新。