Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report 2008 reading parameters from C#

Status
Not open for further replies.

cofimate

Programmer
Jul 27, 2010
2
US
I thought I went by the book exporting parameters for a report

This is my query
SELECT count(*),
FROM campaigns
WHERE campaigns.name like {?Campaign}

Supposed to be pretty simple just need to read Campaign Name in {?Campaign}

So in my page I do the following:
ParameterFields myParameterFields = CrystalReportViewer1.ParameterFieldInfo;
ParameterField pCampaign = new ParameterField();
pCampaign.Name = "Campaign";
ParameterDiscreteValue pCampaignValue = new ParameterDiscreteValue();
pCampaignValue.Value = _CampaignName.Value;
pCampaign.CurrentValues.Add(pCampaignValue);
myParameterFields.Add(pCampaign);

Nothing new these , they are like the samples in the sample of VS2008

I only got Failed to open a rowset. Details: 42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ... most likely I'm not passing the parameters correctly

Appreciate any tip
 
Solve it I follow the sample on Visual Studio and besides I was missing a runtime library
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top