remoting代理类为何返回不了dataset

morningnet 2005-11-03 04:48:54
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!!!!!!!!???????????、
...全文
63 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
morningnet 2005-11-03
  • 打赏
  • 举报
回复
gettime方法后面少了 as string

16,556

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧