看看这个行不行?
Dim S As String = e.Form.Controls("TextBox1").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "SELECT * From {送货地址} Where [客户] = '"& S &"'"
dt = cmd.ExecuteReader()
If dt.DataRows.Count > 0 Then
Messagebox.show("已经存在数据!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("可以增加数据, !","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If