示例代码:填充DataSet

public void TestDataSet() {
    DataSet ds = new DataSet();
    string sql = \"select GBBH, XM, XB, CSNY from GBXX\";
    SqlConnection connection = new SqlConnection(connectionString);
    connection.Open();
    SqlCommand cmd = new SqlCommand(sql, connection);
    SqlDataAdapter adapter = new SqlDataAdapter(cmd);
    adapter.Fill(ds);
    connection.Close();
}