请教一个数据库连接类的调用方法
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace myDbMang
{
/// <summary>
///
/// </summary>
public abstract class DbManagerSQL
{
//数据库连接字符串(web.config来配置)
//<add key="ConnectionString" value="server=127.0.0.1;database=DATABASE;uid=sa;pwd=" />
protected static string connectionString = ConfigurationSettings.AppSettings["ConnectionString"];
public DbManagerSQL()
{
}
/// <summary>
/// 执行查询语句,返回DataSet
/// </summary>
/// <param >查询语句</param>
/// <returns>DataSet</returns>
public static DataSet Query(string SQLString)
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
DataSet ds = new DataSet();
try
{
ds.Clear();
connection.Open(); // 出错位置:提示 ConnectionString 属性尚未初始化。
SqlDataAdapter command = new SqlDataAdapter(SQLString, connection);
command.Fill(ds, "ds");
}
catch (
System.Data.SqlClient.SqlException ex)
{
throw new Exception(ex.Message);
}
return ds;
&nb