remoting代理类为何返回不了dataset
Imports System.Data
Imports System.Data.SqlClient
Imports System.Runtime.Serialization
Namespace n_remoting
<Serializable()> Public Class jwglcs
Inherits MarshalByRefObject
Private Shared m_classinfor As String
Private dbpath As String = "Data Source=JW_s;Initial Catalog=jwgl;User ID=sa;Password=morningnet:;"
Public Sub New()
m_classinfor = m_classinfor + "the class is constructed at" + Now() + Chr(13) + Chr(10)
End Sub
Public Shared ReadOnly Property classinfor() As String
Get
Return m_classinfor
End Get
End Property
Public Function gettime(ByVal name As String)
gettime = "hello " + name + ":this is your time " + Format(Now(), "yyyy-mm-dd hh:mm:ss") + Chr(13) + Chr(10)
m_classinfor = m_classinfor + Chr(13) + Chr(10) + " the gettime is called " + Now()
End Function
'返回一个表集合dataset
Public Function Getdataset(ByVal strSql As String, ByVal tableName As String) As DataSet
Dim DS As New DataSet()
Dim myConn As New SqlConnection(dbpath)
myConn.Open()
Dim myAda As New SqlDataAdapter(strSql, myConn)
myAda.Fill(ds, tableName)
myConn.Close()
Return ds
End Function
End Class
End Namespace
调有时可以看见gettime方法,但是看不见Getdataset ,后来发现只要方法返回的是string,都可以看见,为什么???我意思是dim myobj as new jwglcs
myobj.~~~~~~后面的自动提示没有getdataset!!!!!!!!???????????、