[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 768
  • Last Modified:

Could not find stored procedure 'False'.

using the following:

  Private Sub PopulateApps()

        Dim b As New BuildDetails
        Dim ds As DataSet
        Dim dvw As DataView

        ds = b.GetBuildApp(Session("ComputerID2"))
        dvw = ds.Tables(0).DefaultView()
        dvw.Sort() = "AppName"
        With ddlApps
            .DataSource = dvw
            .DataValueField = "ApplicationID"
            .DataTextField = "AppName"
        End With
        ddlApps.DataBind()

    End Sub

Function:

  Friend Function GetBuildApp(ByVal ComputerID As String) As DataSet
        Dim db As New DataAccess
        Dim cn As New SqlConnection(db.ConnectStr)
        Dim sSQL As String = "Select ca.ComputerID, a.ApplicationID, a.AppName " & _
                            "From tblComputerApplication ca " & _
                            "INNER JOIN tblApplication as a ON ca.ApplicationID=a.ApplicationID " & _
                            "Where ComputerID" = ComputerID
        Dim da As New SqlDataAdapter(sSQL, cn)
        Dim ds As New DataSet("App")
        cn.Open()
        da.Fill(ds, "App")
        cn.Close()
        Return ds
    End Function

I get the following error:

Could not find stored procedure 'False'.
0
OSLAdmin
Asked:
OSLAdmin
  • 3
  • 3
  • 2
  • +2
1 Solution
 
David H.H.LeeCommented:
OSLAdmin ,
This line :  
"Where ComputerID" = ComputerID
Change to
 "Where ComputerID = " & ComputerID
0
 
DotNetLover_BaanCommented:
Change your SQL String

        Dim sSQL As String = "Select ca.ComputerID, a.ApplicationID, a.AppName " & _
                            "From tblComputerApplication ca " & _
                            "INNER JOIN tblApplication a ON ca.ApplicationID=a.ApplicationID " & _
                            "Where ComputerID" = ComputerID
0
 
DotNetLover_BaanCommented:
oops.... typo...
but x_com has done that , already...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
OSLAdminAuthor Commented:
that does not solve the problem unfortunatly
0
 
AerosSagaCommented:
somewhere you have specified stored procedure as your command type.  That is what is causing the error.  Look for any text containing storedprocedure.
0
 
AerosSagaCommented:
where does it error out at?
0
 
DotNetLover_BaanCommented:
Ok do this...

  Friend Function GetBuildApp(ByVal ComputerID As String) As DataSet
        Dim db As New DataAccess
        Dim cn As New SqlConnection(db.ConnectStr)
        'Change SQL String a bit
        Dim sSQL As String = "Select ca.ComputerID, a.ApplicationID, a.AppName " & _
                            "From tblComputerApplication ca, tblApplication a WHERE ca.ApplicationID=a.ApplicationID " & _
                            "AND ComputerID=" & ComputerID
        Dim da As New SqlDataAdapter(sSQL, cn)
        da.SelectCommand.CommandType = CommandType.Text  'Add this line
        Dim ds As New DataSet("App")
        cn.Open()
        da.Fill(ds, "App")
        cn.Close()
        Return ds
    End Function
0
 
David H.H.LeeCommented:
OSLAdmin,
>>ByVal ComputerID As String,
Your ComputerID is string or integer type? If string type, you need to add double quoted around your id.
eg:
"Where ComputerID = ' " & ComputerID & "' " (String)
or
"Where ComputerID = " & Ctype(ComputerID,Integer) (not string)
-Others that, i cant see any error based on your existing code


0
 
AerosSagaCommented:
look for this somewhere in your code:

cmd.CommandType = CommandType.StoredProcedure
0
 
jnhorstCommented:
x_com first obervation is right, but you need to put single quotes around your computer id string.

Try:

Dim sSQL As String = "Select ca.ComputerID, a.ApplicationID, a.AppName " & _
                            "From tblComputerApplication ca " & _
                            "INNER JOIN tblApplication as a ON ca.ApplicationID=a.ApplicationID " & _
                            "Where ComputerID = '" & ComputerID & "'"

And then if this does not work, create a command with the above sql and use it to create the adapter.

Dim cmd As New SqlCommand(sSQL)
Dim da As New SqlAdapter(cmd)

John


0
 
jnhorstCommented:
Oops, x_com has already seen that... if it works point go to him.

John
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now