Tuesday, 8 February 2011

Cannot change table design in SQL Management Studio 2008?!

Theres a stupid change to SQL Management Studio in 2008. When you go into design view in a table and make a change to a table structure that requires the table to be recreated (such as changing Allow Nulls, or making a column an Identity), the damn thing won't allow you to save the changes. Instead you'll get an irritating message allowing you only a Cancel option - so you lose your changes and are stuck.

After a lot of RDC to the server to use its 2005 Management Studio, I found this solution:

Go to: Tools > Options > Designers > Tables and Designers

and uncheck the Prevent Saving Changes that require table re-creation option

This will give you "normal" functionality whereby you can amend a table all you like.

Wednesday, 19 January 2011

Crystal Reports in Visual Studio 2010 Parameters Problem

I am banging my head off a brick wall.

I am working with Visual Studio 2010, creating a Crystal Report which is based on a stored procedure with 2 parameters. The report has 1 subreport with 3 parameters, 2 of which are the same as the main report (linked) and the other is based upon a field in the main report’s stored procedure (also used a subreport link here).

I can view the report in the preview window and it all works perfectly, prompting only for the main report’s 2 parameters.

In C#, I can get no further than “{missing parameter values}” when I try to run the report, Google yields lots of search results on this problem but the solutions don’t work and were generally posted in 2004ish for CR as a standalone product rather than something in Visual Studio.

I contacted SAP, they said it’s Microsoft I need to ask (buck nicely passed). I’m completely stuck and frustrated, if anyone knows the answer please tell me!

Any help much appreciated

Cheers


Current Code:

ParameterDiscreteValue ThisParameterValue = new ParameterDiscreteValue();
            ThisParameterValue.Value = ClientRef;
            ValuationReport.ParameterFields["@ClientRef"].CurrentValues.Add(ThisParameterValue);



UPDATE: You cannot use Crystal for VS2010 if you have VS2008 installed, they conflict with eachother. VS2010 Crysatral wont run aganst SQL2000 so I had no choice but to uninstall Crystal 2010, create the report in a 2008 class library, and then reference the library from my 2010 project.

This worked a treat.