Neebie - Compiler Error

C

Clive-S

Hi,

I am trying to learn ASp.Net.

My page, connecting to SQL Server (ECTSERVER\SQLEXPRESS) 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(Namespace := "http://localhost/coursework/")>
_
Line 11:
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Line 12: 'Public Class DBConnect
Line 13: 'Inherits System.Web.Services.WebService

Source File: D:\wwwroot\coursework\DBConnect.asmx Line: 11


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

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Services

Public Class DBConnect : Inherits WebService

<WebService(Namespace := "http://localhost/coursework/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
'Public Class DBConnect
'Inherits System.Web.Services.WebService

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

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

'** Dim MyConnection As SqlConnection = New
SqlConnection("server=(local)
\NetSDK;database=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=ECTSERVER
\SQLEXPRESS; Initial Catalog=lab; Integrated Security=True")
Dim myCommand As New SqlCommand(strSQl, myConnection)
myConnection.Open()

Dim myDataAdapter As New SqlDataAdapter()
myDataAdapter.SelectCommand = myCommand

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

Dim myDataSet As New DataSet
myDataAdapter.Fill(myDataSet)
myConnection.Close()

'Return DS
Return myDataSet

End Function

<WebMethod()> Public Function GetTelDir() As DataSet
Return GetDataSet("SELECT LastName + ', ' FirstName AS Name,
Extension FROM Employees ORDER BY Name ASC")
End Function

End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top