- Rongsen.Com.Cn 版权所有 2008-2010 京ICP备08007000号 京公海网安备11010802026356号 朝阳网安编号:110105199号
- 北京黑客防线网安工作室-黑客防线网安服务器维护基地为您提供专业的
服务器维护
,企业网站维护
,网站维护
服务 - (建议采用1024×768分辨率,以达到最佳视觉效果) Powered by 黑客防线网安 ©2009-2010 www.rongsen.com.cn
作者:黑客防线网安VB教程基地 来源:黑客防线网安VB教程基地 浏览次数:0 |
//存储过程代码
CREATE PROCEDURE [AddNewInvoiceInfo] (@sUserID int,@sClaimMethod varchar(50),@sInvoiceNum
varchar(50),@sInvoiceDate datetime,@sBuyCity varchar(50))AS
Insert Into SMB_InvoiceInfo (MemberID,ClaimMethod,InvoiceNum,InvoiceDate,InvoiceCity) Values
(@sUserID,@sClaimMethod,@sInvoiceNum,@sInvoiceDate,@sBuyCity)
return @@IDENTITY
GO
//调用存储过程代码
Dim CN As New SqlConnection()
Dim InvoiceID As String
Try
CN.ConnectionString = DBConStr
CN.Open()
Dim CMD As SqlCommand
CMD = New SqlCommand(AddNewInvoiceInfo, CN)
CMD.CommandType = CommandType.StoredProcedure
CMD.Parameters.Add(New SqlParameter(@sUserID, SqlDbType.Int))
CMD.Parameters(@sUserID).Value = CInt(UserID.Text)
CMD.Parameters.Add(New SqlParameter(@sClaimMethod, SqlDbType.VarChar, 50))
CMD.Parameters(@sClaimMethod).Value = TransName.Text
CMD.Parameters.Add(New SqlParameter(@sInvoiceNum, SqlDbType.VarChar, 50))
CMD.Parameters(@sInvoiceNum).Value = InvoiceNum.Text
CMD.Parameters.Add(New SqlParameter(@sInvoiceDate, SqlDbType.DateTime))
CMD.Parameters(@sInvoiceDate).Value = InvoiceDate.SelectedDate.Date
CMD.Parameters.Add(New SqlParameter(@sBuyCity, SqlDbType.VarChar, 50))
CMD.Parameters(@sBuyCity).Value = BuyCity.Text
CMD.Parameters.Add(New SqlParameter(@sInvoiceID, SqlDbType.Int))
CMD.Parameters(@sInvoiceID).Direction = ParameterDirection.ReturnValue
CMD.ExecuteNonQuery()
InvoiceID = CMD.Parameters(@sInvoiceID).Value.ToString()
CMD.Dispose()
Catch ex As Exception
Response.Write(ex.ToString())
Finally
CN.Close()
End Try
我要申请本站:N点 | 黑客防线官网 | |
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479 |