[c#]代码库
ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings["DB"];
DbProviderFactory provider = DbProviderFactories.GetFactory(settings.ProviderName);
using (DbConnection conn = provider.CreateConnection())
{
conn.ConnectionString = settings.ConnectionString;
conn.Open();
DbCommand cmd = conn.CreateCommand();
cmd.CommandText = "Select top 10 * From ShortTermBill";
DbDataAdapter da = provider.CreateDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds);
da.Dispose();
Console.WriteLine(ds.Tables[0].Rows[0]["BillCode"]);
}