Function For SqlConnection In Webservice (Urgent)

manish_joisar

New member
Joined
Aug 26, 2004
Messages
1
Programming Experience
10+
Imports System.Data.SqlClient

Imports System.Web.Services

<System.Web.Services.WebService(
Namespace:="http://Localhost/WebService")> _

Public Class Connection

Inherits System.Web.Services.WebService



Public Sql_Conn As SqlConnection

<WebMethod()> _

Public Function F_Connection(ByVal A_DataBase As String, ByVal A_ServerName As String) As SqlConnection

Sql_Conn =
New SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Weaving;" & _

" user id=sa;pwd=;Data source=Optimal2000")

Sql_Conn.Open()

F_Connection = Sql_Conn

End Function

End
Class

Giving Error

Cannot serialize member System.ComponentModel.Component.Site of type System.ComponentModel.ISite because it is an interface.


Same Method work well in same class
 
Top Bottom