Click here to Skip to main content
15,896,481 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on desktop application using C#.NET and SQL SERVER 2008
i have 2 tabes namely Media _Method and Target_Audience

i want that data should get displayed of both tables on particular report.i Have tried following code


CrystalReport1  objRpt = new CrystalReport1();
 
string connString = "Data Source=SW-PC-20;Initial Catalog=PSM;Integrated Security=True";
SqlConnection Conn = new SqlConnection(connString);
SqlDataAdapter adepter = new SqlDataAdapter("select m.Media_method_ID,m.Media_Name ,t.Target_Audience_ID,t.Target_Audience   from Media_Method m,Target_Audience t where m.Media_method_ID=t.Media_method_ID", connString);

  DataSet1 Ds = new DataSet1();
        
 adepter.Fill(Ds, "Media_Method"+"Target_Audience");
 
 objRpt.SetDataSource(Ds);
   crystalReportViewer1.ReportSource = objRpt;
Posted
Comments
thatraja 10-May-11 14:21pm    
what's the result? any error? if yes then include that in your question.
shivani 2013 10-May-11 23:45pm    
there is no error but data is not fetched ,the way it fetched the data for single table

1 solution

 
Share this answer
 
Comments
shivani 2013 11-May-11 1:26am    
thanx

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900