I have used a dataset in many of my windows forms for datagrid. As you can see i have project level dataset created.
The problem is i would liek to resume that dataset inside code to assing source for crystal report as follow.
//sbmsDataSetAllis not recognized
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("rystalReport1.rpt");
cryRpt.SetDataSource(sbmsDataSetAll.Tables["recent_slide_dataset"].DataSet) ;
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh();
OK, but you need to understand that these dataset items you see in the solution explorer are representing class types(things you can create) not object instances(things you have created) so you can only use object instances in your code
On the form where your dataset is created, with some code like
sbmsDataSetAll myDataset = new sbmsDatasetAll();
is where the instance of the dataset is. It is only on this form's code that you can link it to the report unless you have passed the dataset to another place via method parameters.
You should really pass one of the tables inside the dataset as the crystal report datasource, unless you already told crystal what table name to use (in design mode somewhere - I can't see it in your code). When you work with strongly typed datasets like these you don't need to use the .Tables collection. Every table in the set has a named property for the table:
cryRpt.SetDataSource(sbmsDataSetAll.recent_slide_dataset) ;
You also don't need to call a table's DataSet Property because that just points back to the dataset the table is in, which you already know when you chose the table:
cryRpt.SetDataSource(sbmsDataSetAll) ;
As another small critique, in c# we use PascalCase of object, property and method names, so your dataset entities should really be named like:
cryRpt.SetDataSource(SbmsDataSetAll.RecentSlides) ;