asp.net(VB)中存储过程的使用方法(与直接执行SQL语句基本相同,不同之处在于红色字体部位)
'连接数据库(使用udl文件链接数据库)
Dim DBPath as string = server.MapPath("condb.udl")
Dim conn AS OleDBConnection = New OleDBConnection("File Name =" & DBPath)
conn.Open()
'存储过程名称:YW_HRHSXX_1
Dim prostr As String = "YW_HRHSXX_1('2003','01',1,1,1,1,'2003-02-08','hddd','1','2','3','4','1','2','3','4','1','2')"
Cmd = New OLEDBCommand(prostr, conn)
'设置执行语句类型为存储过程
Cmd.CommandType=CommandType.StoredProcedure
Cmd.ExecuteNonQuery()
Cmd.connection.close()
conn.close()
本文地址:http://com.8s8s.com/it/it45690.htm