ReportDocument rptDoc = new ReportDocument(); DataSet1 ds1 = new DataSet1(); // .xsd file name DataTable dt = new DataTable(); // Just set the name of data table dt.TableName = "bill"; dt = getAllOrders(); //This function is located below this function ds1.Tables[0].Merge(dt);<<<<<<getting error here : .column1 and .column1 have conflicting properties: DataType property mismatch.>>>>>>> // Your .rpt file path will be below rptDoc.Load(Server.MapPath("../WebSite2/CrystalReport.rpt")); //set dataset to the report viewer. rptDoc.SetDataSource(ds1); CrystalReportViewer1.ReportSource = rptDoc; public DataTable getAllOrders() { //Connection string replace 'databaseservername' with your db server name string sqlCon = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Apps\WebSite2\Database21.accdb;Persist Security Info=False;"; OleDbConnection Con = new OleDbConnection(sqlCon); OleDbCommand cmd = new OleDbCommand(); DataSet ds = null; OleDbDataAdapter adapter; try { Con.Open(); cmd = Con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select *from bill"; ds = new DataSet(); adapter = new OleDbDataAdapter(cmd); adapter.Fill(ds, "bill"); cmd.ExecuteNonQuery(); }
ds1.Tables[0].Merge(dt);
datatables
datatype
DataTables
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)