SqlConnection con = new SqlConnection(connection);
string sqlstring = "...";
SqlCommand command = new SqlCommand(sqlstring, con);
SqlDataAdapter sda = new SqlDataAdapter(command);
DataSet ds = new DataSet();
sda.Fill(ds, "tablename");
楼主自己可以看看msdn,都有示例的。