Neebie - Compiler Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Clive-S

    #1

    Neebie - Compiler Error

    Hi,

    I am trying to learn ASp.Net.

    My page, connecting to SQL Server (ECTSERVER\SQLE XPRESS) has the
    following
    line continuation error?????

    I do not understand the error & solution. Any help is appreciated.

    Does anyone know a link to Server-Side Javascript examples????

    Thanks

    Clive

    Compiler Error Message: BC32035: Attribute specifier is not a complete
    statement.
    Use a line continuation to apply the attribute to the following
    statement.

    Source Error:

    Line 9:
    Line 10: <WebService(Nam espace := "http://localhost/coursework/")>
    _
    Line 11:
    <WebServiceBind ing(ConformsTo: =WsiProfiles.Ba sicProfile1_1)_
    Line 12: 'Public Class DBConnect
    Line 13: 'Inherits System.Web.Serv ices.WebService

    Source File: D:\wwwroot\cour sework\DBConnec t.asmx Line: 11


    '************** *************** *************** *************** *********
    <%@ WebService Language="VB" Class="DBConnec t" %>

    Imports System
    Imports System.Data
    Imports System.Data.Sql Client
    Imports System.Web.Serv ices

    Public Class DBConnect : Inherits WebService

    <WebService(Nam espace := "http://localhost/coursework/")_
    <WebServiceBind ing(ConformsTo: =WsiProfiles.Ba sicProfile1_1)_
    'Public Class DBConnect
    'Inherits System.Web.Serv ices.WebService

    '<WebMethod()_
    'Public Function HelloWorld() As String
    ' Return "Hello World"
    'End Function

    '*** <WebMethod()>
    Private Function GetDataSet(ByVa l strSQl As String) As DataSet

    '** Dim MyConnection As SqlConnection = New
    SqlConnection(" server=(local)
    \NetSDK;databas e=pubs;Trusted_ Connection=yes" )
    '** Dim MyCommand1 As SqlDataAdapter = New
    SqlDataAdapter( "select * from Authors", MyConnection)
    '** Dim MyCommand2 As SqlDataAdapter = New
    SqlDataAdapter( "select * from Titles", MyConnection)

    Dim myConnection As New SqlConnection(" Data Source=ECTSERVE R
    \SQLEXPRESS; Initial Catalog=lab; Integrated Security=True")
    Dim myCommand As New SqlCommand(strS Ql, myConnection)
    myConnection.Op en()

    Dim myDataAdapter As New SqlDataAdapter( )
    myDataAdapter.S electCommand = myCommand

    '** Dim DS As New DataSet
    '** MyCommand1.Fill (DS, "Authors")
    '** MyCommand2.Fill (DS, "Titles")

    Dim myDataSet As New DataSet
    myDataAdapter.F ill(myDataSet)
    myConnection.Cl ose()

    'Return DS
    Return myDataSet

    End Function

    <WebMethod()Pub lic Function GetTelDir() As DataSet
    Return GetDataSet("SEL ECT LastName + ', ' FirstName AS Name,
    Extension FROM Employees ORDER BY Name ASC")
    End Function

    End Class

Working...