("Select count(*) From 表名 Where 字段名='"& 文本名.text &"'") 下一步怎样取得返回的值?
Dim ConnString As String = "Data Source=localhost;" & _
"Initial Catalog=数据库名;User ID=sa;Password=123456"
Dim objCmd As New SqlDataAdapter("Select distinct * From 表名 &_
Where 字段名='"& 文本名.text &"'", ConnString)
Dim DS As New DataSet()
objCmd.Fill(DS, "表名")
Dim myTable As DataTable = DS.Tables("表名")
Dim mycount as integer=myTable.rows.count
if mycount = 0 then
response.redirect("b.aspx")
else
response.redirect("a.aspx")
end if
这是我写的 代码 请高手帮忙改一改 主要目的是验证用户名是否重复