你好.能问你个关于VB.NET的问题吗?

定义了一个类:类的名称为:DataBinding.vb其代码如下:NamespaceTechBookPublicClassDataBindingPublicSharedS... 定义了一个类:类的名称为:DataBinding.vb 其代码如下:
Namespace TechBook
Public Class DataBinding
Public Shared Sub FillSistView(ByRef lsv As ListView, ByVal tableName As String, ByVal num As Integer, ByVal connStr As String, _
Optional ByVal field As String = "", Optional ByVal op As String = "=", Optional ByVal value As String = "")
lsv.Items.Clear()
Dim SQLString As String = "SELECT * FROM " & tableName
If field <> "" Then
SQLString += " Where " & field & op & value
End If
Dim dt As DBDataTable = New DBDataTable(connStr)
Dim table As DataTable = dt.CreateDataTable(SQLString, tableName)
Dim UserRow As DataRow
Dim lItem As ListViewItem
For Each UserRow In table.Rows
lItem = New ListViewItem(UserRow(0).ToString())
Dim i As Integer
For i = 1 To num - 1
lItem.SubItems.Add(UserRow(i))
Next
lsv.Items.Add(lItem)
Next
End Sub
End Class
End Namespace

在程序调用这个类时,总是出错:出错的提示为:未声明名称DataBingding.
程序的代码如下:
Public Class frmSearchProduct
Private Shared ConnStr As String = "Server=Tony;DataBase=Super;Integrated Security=SSPI"
Private Sub frmSearchProduct_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataBinding.FillSistView(ListView1, "Product", 9, ConnStr)
RadioButton1.Checked = True
TextBox1.Select()
End Sub
Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim strField As String
Dim strValue As String
If RadioButton1.Checked Then
strField = "编号"
strValue = "" & TextBox1.Text & "'"
Else
strField = "供货商编号子"
strValue = "'" & TextBox1.Text & "'"
End If
ListView1.Items.Clear()
DataBinding.FillSistView(ListView1, "Product", 9, ConnStr, strField, "=", strValue)
End Sub
End Class

请问一下问题出在哪里?
请帮忙,在下先谢谢了.
展开
 我来答
liaoiao88
2010-09-19 · 超过43用户采纳过TA的回答
知道小有建树答主
回答量:105
采纳率:100%
帮助的人:103万
展开全部
需要在你的frmSearchProduct类前面引用名称空间TechBook

方法是
Public Class frmSearchProduct '语句前面加上

Imports TechBook
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式