user42348
user42348

Reputation: 4319

Regarding syntax in c# and vb

I have a web service in c# and its working well in c#.Following is one method i used in it

[WebMethod(EnableSession = true)]
        public void abc(BllNew objNew)
        {
            new DAL.Entity.BllNew().sample();
        }

But again i implemented above method in vb and is like this

[WebMethod(EnableSession = true)]
        public void abc(BllNew objNew)
        {
            new DAL.Entity.BllNew().sample();
        }

One syntax error is showing near 'new' keyword.What change i hve to get rid of syntax error.Pls help.

Upvotes: 0

Views: 146

Answers (2)

RBarryYoung
RBarryYoung

Reputation: 56755

Well, I don't have all of your libraries, but I think that this is right:

<WebMethod(EnableSession:=True)> _
Public Sub abc(ByVal objNew As BllNew)
    dim d as New DAL.Entity.BllNew().sample()
End Sub

Upvotes: 2

Robert Harvey
Robert Harvey

Reputation: 180908

Try this:

<WebMethod(EnableSession := True)> _
Public Sub abc(objNew As BllNew)
    New DAL.Entity.BllNew().sample()
End Sub

Upvotes: 1

Related Questions