Dim UserName As String = e.Form.Controls("UserName").Value Dim cmd As New SQLCommand Dim dt As DataTable Dim dr As DataRow 'cmd.Connection Name = "test2" 外部数据源 If UserName = "" Then Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) Return End If