求解??谢谢!!存储过程“sp_UPxx”在sql查询分析器只需几分钟执行完,但在vb里调用需要30分钟。
如题,下面是调用代码:Dim myStr As String = ("server=" & ServerIp & ";database=" & Dbname & ";uid=" & Username & ";pwd=" & Password & "")
Dim myConn As New SqlConnection(myStr)
myConn.Open()
Dim cmd As New SqlCommand("sp_UPxx", myConn)
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandTimeout = 0
Dim returnvalue As SqlParameter = cmd.Parameters.Add("@returnvalue", SqlDbType.Int)
returnvalue.Direction = ParameterDirection.ReturnValue
cmd.ExecuteNonQuery() --------------------编程问答-------------------- 你在创建的存储过程里加上with recompile试试看有没有改善 --------------------编程问答-------------------- 关注,楼主把试验结果反馈一下阿
补充:VB , 基础类