public static string conString = @"Server=localhost;Integrated Security=True; Database=northwind";

1. 执行Sql语句, 返回受影响的行数
 rows;
        }
调用方法:
        string strSql=@"select * from Customers";
        
int rows = ExecuteSql(strSql);
不知道为什么, 测试了一下, 返回的rows竟然是-1. 暂时没有找到原因.

2. 执行查询语句, 返回DataSet
 thisDataSet;
        }
调用方法:
        string strSql = @"select * from Customers";
        DataSet ds 
= Utility.Query(strSql);

3. 执行一条计算查询结果语句, 返回查询结果(object)
 obj;
            }
        }
调用方法:
        string strSql = @"select * from Customers";
        
string num = Utility.GetSingle(strSql).ToString();

5. 带参数, 执行SQL语句, 返回影响的记录数
..............

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2021-12-31
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
相关资源
相似解决方案