> 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?
Does usp_Has_Access run correctly when run directly?