为什么我没有在函数中获得数据表?

时间:2015-05-24 13:09:13

标签: .net vb.net

这已经修复我错过了executeqlquery

中的add参数

我一直这样做,但是,我不明白,当我在@companyID中硬编码companyID时,我得到了返回objProjectDS的正确,但是,如果我使用了我声明的参数,我什么都没得到,任何人都可以解释对我来说?提前谢谢。

Public Function fnLoadProjectCodeList(ByRef intCompanyID As Integer, ByVal intIncSelectLater As Integer) As DataTable

    Dim strProjectLoadSQL As String = ""
    Dim objProjectDS As DataTable = Nothing
    Dim objMyCollect As New Collection()


    Try
        strProjectLoadSQL = "Select Project_id as id,Project_Code, Quote_Code_id from project_code where company_id = @companyID and Deleted_flag='N';"
        Dim objParam1 As New MySqlParameter("@companyID", intCompanyID)
        objMyCollect.Add(objParam1)


objProjectDS =StringBusinessObject.Web.ClassBusinessObjectMySQL.fnExecuteSQLQuery(strProjectLoadSQL, objMyCollect).Tables(0)

Catch ex As Exception

    End Try

    Return objProjectDS

End Function

0 个答案:

没有答案