Solved

Could not find stored procedure 'False'.

Posted on 2004-09-13
11
709 Views
Last Modified: 2008-03-10
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
Comment
Question by:OSLAdmin
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 12043999
OSLAdmin ,
This line :  
"Where ComputerID" = ComputerID
Change to
 "Where ComputerID = " & ComputerID
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 12044002
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
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 12044020
oops.... typo...
but x_com has done that , already...
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:OSLAdmin
ID: 12044206
that does not solve the problem unfortunatly
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12044304
somewhere you have specified stored procedure as your command type.  That is what is causing the error.  Look for any text containing storedprocedure.
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12044306
where does it error out at?
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 12044350
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
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 500 total points
ID: 12044420
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
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12044736
look for this somewhere in your code:

cmd.CommandType = CommandType.StoredProcedure
0
 
LVL 10

Expert Comment

by:jnhorst
ID: 12046771
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
 
LVL 10

Expert Comment

by:jnhorst
ID: 12046783
Oops, x_com has already seen that... if it works point go to him.

John
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question