// /// <summary> /// 执行查询语句,返回DataSet /// </summary> /// <param name="SQLString">查询语句</param> /// <returns>DataSet</returns> public static DataSet Query(string SQLString) { return((DataSet)ReflexTools.ExecuteMethod(conType, "Query", new object[] { SQLString })); }
/// <summary> /// 得到一个数据集合 /// </summary> /// <param name="SQLString">sql语句</param> /// <returns>DataTable</returns> public static DataTable GetTable(string SQLString) { return((DataTable)ReflexTools.ExecuteMethod(conType, "GetTable", new object[] { SQLString })); }
//数据库连接字符串(web.config来配置),可以动态更改connectionString支持多数据库. public static void SetConnection(string connectionStr) { ReflexTools.ExecuteMethod(conType, "SetConnection", new object[] { connectionStr }); }
/// <summary> /// 测试是否连接到数据库 /// </summary> /// <returns>连接状态</returns> public static bool TestConnect() { return((bool)ReflexTools.ExecuteMethod(conType, "TestConnect", null)); }
/// <summary> /// 反射得到所有类 /// </summary> /// <returns></returns> public Type[] GetAllTypes() { //获取程序集 所有类 return(typeInfo = typeInfo ?? ReflexTools.GetAllTypes()); }