may i know why do you wanna store datatable to dataset?
As per your code you want datatable to display records in crystalreport. Here i'll show you some example:
Call this from report form
string sqlQuery ="select * from your table";
adp = new SqlDataAdapter(sqlQuery, connection);
dt = new DataTable();
adp.Fill(dt);
CRViewer cvph = new CRViewer();
cvph.dt = dt;
cvph.Show();
CRViewer form:
It contains a crystalReportViewer named crystalReportViewer1
public partial class CRViewer : Form
{
public CRViewer()
{
InitializeComponent();
}
public DataTable dt = new DataTable();
private void CRViewer_Load(object sender, EventArgs e)
{
CRCustomer crph = new CRCustomer();
crph.Database.Tables[0].SetDataSource(dt);
crystalReportViewer1.ReportSource = crph;
}
}