Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Incorrect Syntax Near... Error Message
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Joe  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 18:17
Newsgroups: microsoft.public.dotnet.framework.aspnet
From: Joe <delphi...@cox.net>
Date: Sun, 8 Nov 2009 10:17:21 -0800 (PST)
Local: Sun 8 Nov 2009 18:17
Subject: Incorrect Syntax Near... Error Message
Hi,

       When I execute the code below, I get an error message
"Incorrect syntax near usp_Has_Access".

Shared DefaultDBConn As String = ConfigurationManager.ConnectionStrings
("QuickSize_WebConnectionString").ConnectionString
    Public Shared Function IsUserAuthorized(ByVal sLanID As String) As
Boolean
        Dim cnQuickSizeWeb As New SqlConnection(DefaultDBConn)
        Dim cmdAuthorization As SqlCommand = New SqlCommand

        With cmdAuthorization
            .Connection = cnQuickSizeWeb
            .CommandType = SqlDataSourceCommandType.StoredProcedure
            .CommandText = "usp_Has_Access"
            .Parameters.AddWithValue("@LANID", sLanID)
            cnQuickSizeWeb.Open()
            Try
                Dim rowsAffected As Integer = .ExecuteNonQuery()
                Console.WriteLine("RowsAffected: {0}", rowsAffected)
            Catch ex As Exception
                MsgBox(ex.Message, MsgBoxStyle.Critical)
            End Try
            cnQuickSizeWeb.Close()
        End With
    End Function

The stored procedure usp_Has_Access has one input parameter, @LANID
which is a varchar and it runs fine when I execute it from SQL Server
Management Studio.    Can anyone tell me what I am doing wrong?


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Rae [MVP]  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 18:33
Newsgroups: microsoft.public.dotnet.framework.aspnet
From: "Mark Rae [MVP]" <m...@markNOSPAMrae.net>
Date: Sun, 8 Nov 2009 18:33:31 -0000
Local: Sun 8 Nov 2009 18:33
Subject: Re: Incorrect Syntax Near... Error Message
"Joe" <delphi...@cox.net> wrote in message

news:2dfbbc8b-bb1e-4959-9bfb-4b70af72ff99@f16g2000yqm.googlegroups.com...

> Can anyone tell me what I am doing wrong?

The easiest way to debug this would be to set up a trace on SQL Server and
inspect the raw SQL which the above code is constructing on the fly and then
sending to the database engine...

--
Mark Rae
ASP.NET MVP
http://www.markrae.net


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott M.  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 20:43
Newsgroups: microsoft.public.dotnet.framework.aspnet
From: "Scott M." <s-...@nospam.nospam>
Date: Sun, 8 Nov 2009 15:43:09 -0500
Local: Sun 8 Nov 2009 20:43
Subject: Re: Incorrect Syntax Near... Error Message

"Joe" <delphi...@cox.net> wrote in message

news:2dfbbc8b-bb1e-4959-9bfb-4b70af72ff99@f16g2000yqm.googlegroups.com...

Does usp_Has_Access run correctly when run directly?

-Scott


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google