过程或函数需要未提供的参数

过程或函数需要未提供的参数

本文介绍了过程或函数需要未提供的参数。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI大家这是我最近对我的问题的延续,我想出了我的程序:



VB.net

HI Everyone this is my continuation to my problem lately and I come up with my program with this:

VB.net

Protected Sub UploadBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles UploadBtn.Click

   Dim conn As New SqlConnection("Data Source=192.168.0.4;Initial Catalog=CYBERYA;Persist Security Info=True;User ID=cyberya;Password=Piso4minutes;MultipleActiveResultSets=True")

        ' set up call for stored procedure

        Dim cmdtest As New SqlCommand("Populatecsv", conn)
        cmdtest.CommandType = CommandType.StoredProcedure
        ' parameter settings
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@status", "status"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@CustomerName", "customername"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@HomeContact", "homecontact"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@BusinessContact", "businesscontact"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@MobileContact", "mobilecontact"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@LotHouseNo", "lothouseno"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@RoomUnitStall", "roomunitstall"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@BldgFloor", "bldgfloor"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@BldgName", "bldgname"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@Street", "street"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@Subdivision", "subdivision"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@Barangay", "barangay"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@CityMunicipality", "citymunicipality"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@Province", "province"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@Region", "region"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@Package", "package"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@PromoCode", "promocode"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@ApplicationDate", "applicationdate"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@EndorsedDate", "endorseddate"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@paymenttype", "paymenttype"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@scheduledate", "scheduledate"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@loanstatus", "loanstatus"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@ActivationDate", "activationdate"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@pcdelivery", "pcdelivery"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@nopcavailed", "nopcavailed"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@datepcpickup", "datepcpickup"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@pcissuance", "pcissuance"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@salesagent", "salesagent"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@Coordinator", "Coordinator"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@SalesChannel", "saleschannel"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@SalesGroup", "salesgroup"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@CreatedBy", "CreatedBy"))
        cmdtest.Parameters.Add(New Data.SqlClient.SqlParameter("@timestamp", "timestamp"))
        ' end call params


        conn.Open()
        cmdtest.Connection = conn
        cmdtest.ExecuteNonQuery()
        conn.Close()

End Sub
End Class





然后我想出了这个错误:过程或函数'Populatecsv'需要参数'@SRN',这是未提供的。在这一行





then im come up with this error: "Procedure or function 'Populatecsv' expects parameter '@SRN', which was not supplied." in this line

Line 320:        conn.Open()
Line 321:        cmdtest.Connection = conn
Line 322:        cmdtest.ExecuteNonQuery()
Line 323:        conn.Close()
Line 324:        ''Dim myconnect As New SqlClient.SqlConnection







我想知道我的命令问题在哪里我已经说过数据源请帮帮我们..



非常赞赏:))




im wondering whats the problem of my command where in i already stated the data source please help me guys..

very well appreciated :)

推荐答案


Error converting data type nvarchar to bigint.



在本节中它的含义是什么?



第321行:conn.Open()

第322行:cmdtest.Connection = conn

第323行:cmdtest.ExecuteNonQuery()

第324行:conn.Close()

第325行:''将myconnect变为新的SqlClient.SqlConnection


in this section so what it does means??

Line 321: conn.Open()
Line 322: cmdtest.Connection = conn
Line 323: cmdtest.ExecuteNonQuery()
Line 324: conn.Close()
Line 325: ''Dim myconnect As New SqlClient.SqlConnection


Dim param = New System.Data.SqlClient.SqlParameter()
      param.ParameterName = "@srn"
      param.Direction = ParameterDirection.Output
      param.Size = 10
      cmdtest.Parameters.Add(param)





但我仍然遇到同样的错误此错误将数据类型nvarchar转换为bigint ...帮助人..>。<< / xml>



yet ive still got the same error with regards to this Error converting data type nvarchar to bigint... Help guys.. >.<</xml>


这篇关于过程或函数需要未提供的参数。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-20 19:23