Click here to Skip to main content
12,998,423 members (89,324 online)
Rate this:
Please Sign up or sign in to vote.
<target>.Renewal_Start and <source />.Renewal_Start have conflicting properties: DataType property mismatch.

im facing the error like this

 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
    //set dataset to the report viewer.
    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;
            cmd = Con.CreateCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select *from bill";
            ds = new DataSet();
            adapter = new OleDbDataAdapter(cmd);
            adapter.Fill(ds, "bill");

Posted 16-Jul-12 0:34am
Updated 16-Jul-12 1:30am
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

for ds1.Tables[0].Merge(dt); to work both the datatables have to be union compatible i.e. both of the should contain same number of columns and the respective columns should be of same datatype in each table.

Please ensure that both the datatables conform to this requirement and it will work fine.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Please check your DataTables that they exists same number of columns.

Rahul Rajat Singh 16-Jul-12 8:02am
+4 for the answer. would have given 5 if you would have mentioned that the datatype of respective columns should also match.
AshishChaudha 16-Jul-12 8:03am
Thanks Rahul...Sorry for my mistake..
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

better to use join statement and make view before using it in dataset

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 16 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100