Hi,
i want to assign the SQL table as datasource for pivotgrid.
My code:
void RadPivotGrid1_NeedDataSource(object sender, PivotGridNeedDataSourceEventArgs e)
{
(sender as RadPivotGrid).DataSource = GetDataTable();
}
private DataTable GetDataTable()
{
DataTable dt = new DataTable();
using (SqlConnection conn = new SqlConnection("Data Source=zbserver01;initial Catalog=Sales;User Id=XXX;Password=XXX"))
{
using (SqlCommand cmd = new SqlCommand())
{
cmd.Connection = conn;
cmd.CommandText = "Select * from Car";
SqlDataAdapter adpt = new SqlDataAdapter(cmd);
adpt.Fill(dt);
}
return dt;
}
}
its just show the empty grid,if i am do like this.
Is it possible to assign a normal sql table as datasource for RadPivotGrid.