日期:2014-05-17 浏览次数:20880 次
SqlDataAdapter sda = new SqlDataAdapter("select top 100 * from qun1", conn);
DataTable dt = new DataTable();
if (dt.Rows.Count > 0)
{
sda.Fill(dt);
}
using (SqlConnection conn = new SqlConnection(connStr))
{
conn.Open();
SqlCommand comm = new SqlCommand("select top 100 * from qun1"", conn);
SqlDataReader read = comm.ExecuteReader();
if (read.Read())
{
Response.Write("有数据");
}
else
{
Response.Write("无数据");
}
}