I have code sample in my CR.NET 2008 book on Amazon, but here are some code snippets that might help:
Use the .SetParameter() method to change the current value of parameters.
myReport.SetParameterValue("Country", "USA")
To set the login credentials, use SetDatabaseLogin()
myReport.SetDatabaseLogin("user1", "1234")
If you're using ASP.NET, don't put your code in the page Load() method. It screws up the viewer control in VS2008. Use the On_Init() method instead. This keeps memory clean.
Here is the link for my book:
Crystal Reports.NET 2008 book
Edited by BrianBischof - 26 Oct 2010 at 7:30am