public static string conString = @"Server=localhost;Integrated Security=True; Database=northwind";
1. 执行Sql语句, 返回受影响的行数
}
string strSql=@"select * from Customers";
int rows = ExecuteSql(strSql);
不知道为什么, 测试了一下, 返回的rows竟然是-1. 暂时没有找到原因.int rows = ExecuteSql(strSql);
2. 执行查询语句, 返回DataSet
}
string strSql = @"select * from Customers";
DataSet ds = Utility.Query(strSql);
DataSet ds = Utility.Query(strSql);
3. 执行一条计算查询结果语句, 返回查询结果(object)
}
}
string strSql = @"select * from Customers";
string num = Utility.GetSingle(strSql).ToString();
string num = Utility.GetSingle(strSql).ToString();
5. 带参数, 执行SQL语句, 返回影响的记录数
..............