这是我在代码中绑定的方法,我想通过网络方法调用它
Private Sub BindData()
Dim objtable As New DataTable("projectinfoclass")
Dim Conn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("conString").ConnectionString)
Dim Cmd As SqlDataAdapter = New SqlDataAdapter("select * from ProjectInfoNew", Conn)
Cmd.Fill(objtable)
projectinfolist.Clear()
For Each dr As DataRow In objtable.Rows
projectinfolist.Add(New Projectinfoclass With {
.ProjectNumber = dr("ProjectNumber").ToString(),
.projectId = dr("Projectid").ToString(),
.Projectname = dr("ProjectName").ToString(),
.projectmodifiedDate = dr("ProjectmodifiedDate").ToString(),
.Recordupdateddate = dr("Recordupdateddate").ToString(),
.ProjectLocation = dr("ProjectLocation").ToString(),
.LocationServerName = dr("LocationServerName").ToString(), .ProjectModifiedBy = dr("ProjectModifiedBy").ToString(),
.DBServer = dr("DBServer").ToString(),
.DBName = dr("DBName").ToString(),
.Flag = Nothing})
Next
GridView1.DataSource = objtable
GridView1.DataBind()
End Sub