"CompanyName,ContactName " +
"FROM Customers";
SqlCommand cmd =
new SqlCommand (cmdString, cnn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable("Customers");
da.Fill(dt);
return dt;
}
}
public DataTable GetCustomerOrders(string CustomerID)
{
// 待定
return null;
}
public DataTable GetCustomersByCountry
(string CountryCode)
{
// 待定
return null;
}
public bool InsertCustomer()
{
// 待定
return false;
}
}
}
从 Microsoft® Access 进行数据检索的代码类似于如下所示:
using System;
using System.Data;
using System.Data.Common;
using System.Data.OleDb;
using System.Configuration;
using Common;
namespace DAL
{
public class CustomersData : IDbCustomers
{
public DataTable GetCustomers()
{
文章来源于领测软件测试网 https://www.ltesting.net/