.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

how to merge two dataset in a crystal report?

Posted By: rashmi     Posted Date: July 19, 2011    Points:5   Category :C#
how to merge two dataset in a crystal report

Responses
Author: Narayanan             
Posted Date: July 19, 2011     Points: 20   

Hi,
http://stackoverflow.com/questions/4898886/merge-two-or-more-crystal-reports-to-a-single-pdf
http://forums.asp.net/t/1694616.aspx/1?passing+two+datasets+to+crystal+report+
http://forums.devx.com/showthread.php?t=137438


Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
Author: Ravi Ranjan Kumar             
Posted Date: July 20, 2011     Points: 20   

The two DataSets you've mentioned have the same schema or structure, just use the DataSet.Merge Method (DataSet) to merge them into one, and then bind to the report
take a look to know more details about DataSet.Merge method
http://msdn.microsoft.com/en-us/library/4swwh51k.aspx

Thanks & Regards
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com
Author: Sasi Prabhu             
Posted Date: July 29, 2011     Points: 20   

Try :

SqlConnection cn = new SqlConnection("Write your connection string here");

SqlDataAdapter da1 = new SqlDataAdapter("select * from table1", cn);
DataSet ds = new DataSet();
da1.Fill(ds, "temp");

SqlDataAdapter da2 = new SqlDataAdapter("select * from table2", cn);
DataSet ds1 = new DataSet();
da2.Fill(ds1, "temp");

ds.Merge(ds1);
GridView1.DataSource = ds.Tables[0].DefaultView;

label1.Text = ds.Tables[0].Rows.Count.ToString();



or


targetDataSet.Merge(sourceDataSet)



Refer :

http://www.devasp.net/net/articles/display/706.html

Thanks & Regards,
Sasi Prabhu.
Author: Gowthammanju             
Posted Date: July 29, 2011     Points: 20   

try these coding as

Dim oReport As new ReportDocument

oReport.SetDataSource(MyDataSet.Tables("MyDataTable1"))


Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Ravi Ranjan Kumar             
Posted Date: July 30, 2011     Points: 20   

hey! Gowthammanju how this code is helpful for OP. will you explain it. or OP needs solution in C# and your answer is targeting VB.net.


Thanks & Regards
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend