Solved

Could not find stored procedure 'False'.

Posted on 2004-09-13
11
718 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: 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!

 

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

756 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