我制作了代码vb net,可以在我的表单中显示,我使用数据集调用数据,我的编码如下
Public Function GetTableRow(ByVal strsql As String) As DataSet
Dim conn As New SqlConnection
Dim sDa As New SqlDataAdapter(strsql, conn)
Dim ds As New DataSet
Try
sDa.Fill(ds)
Catch ex As Exception
End Try
sDa.Dispose()
Return ds
End Function
Private Sub CmRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmRefresh.Click
Dim ds As New DataSet
Dim conn = "server='server'; database='database'; user=user;password='password';"
Dim strsql As String = "exec spSPDMonStockProductHarian '" & 230 & "'"
ds = conn.GetTableRow(strsql)
With Listdata
.DataSource = ds.Tables(0)
End With
Koneksi.Close()
Koneksi.Close()
End Sub
执行此程序时出现问题,错误消息
"Public member 'Function' on type 'String' not found."
我没有得到什么问题,所以任何解决方案将不胜感激!