Hi,
thx for the answer, i think this is what i was searching for.
But i cant test it, because i want to give this data to a Crystal Report,
and if i say
"
ReportDocument rd = new ReportDocument();
rd.Load("F:\\crRechnung.rpt");
rd.Database.Tables[0].SetDataSource(ds.Tables[0]);
//rd.Database.Tables[0].SetDataSource(ds); //doesnt work too
crystalReportViewer.ReportSource = rd;
"
I get the answer that the Table index of my rd.Database is not valid. But i
cant find any function to add a new table in there. Do you know that problem
too and give me a help ?
Thx and regards
Fabian
"Ashura" wrote:
heres a simple 1
void InitializeDataGrid() {
DataSet ds = new DataSet("DataSet");
DataTable data = new DataTable("Data");
DataColumn dtCol = null;
dtCol = new DataColumn("ID");
dtCol.DataType = typeof(System.Int32);
data.Columns.Add(dtCol);
dtCol = new DataColumn("Name");
dtCol.DataType = typeof(System.String);
data.Columns.Add(dtCol);
DataRow dr = null;
for(int i = 0; i < 10; i++) {
dr = data.NewRow();
dr["ID"] = i;
dr["Name"] = "Name[" + i + "]";
data.Rows.Add(dr);
}
ds.Tables.Add(data);
grdData.DataSource = ds.Tables[0];
}