Dim Conn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnStr"))
dim strSQL as string="Select Count(ID) AS Nub from [xxx]"
dim Cmd as new SqlCommand(strSQL,Conn)
Conn.open()
dim iCount as integer=SqlCommand.ExecuteScalar() '计算记录的个数
Conn.close()
温馨提示:答案为网友推荐,仅供参考