Click here to Skip to main content
11,797,355 members (75,910 online)
Rate this: bad
Please Sign up or sign in to vote.
.Renewal_Start and .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
Edited 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 at 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 at 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
0 CPallini 475
1 Maciej Los 370
2 OriginalGriff 363
3 Abhinav S 344
4 Andy Lanng 296
0 OriginalGriff 2,092
1 Maciej Los 1,760
2 KrunalRohit 1,436
3 CPallini 1,245
4 ppolymorphe 893

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 16 Jul 2012
Copyright © CodeProject, 1999-2015
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