My c# winforms use a report viewer to access crystal reports. Basically I have a Crystal Reports ReportViewer placed on a winforms. I pass to it the report i want to run. I load the report. I load various parameters from the apps config file to set up the connection info. I update the data source to ensure it is pointing to the correct database. I set the logon object to the users proper credentials and set my criteria and call the asmx file which in turn runs the report and sends the data back to the viewer form.
Everything works fine as long as i use sql server authentication. Here is my connection properties being set.
public void RetrieveAppSettings()
{
connectionInfo.ServerName = ConfigurationManager.AppSettings["DatabaseServer"];
connectionInfo.DatabaseName = ConfigurationManager.AppSettings["DatabaseName"];
connectionInfo.UserID = ConfigurationManager.AppSettings["DatabaseUserName"];
connectionInfo.Password = ConfigurationManager.AppSettings["DatabasePassword"];
reportServer = ConfigurationManager.AppSettings["UAReportServer"];
reportSource = reportServer + "/" + reportName + "Service.asmx";
}
Now i want to switch to Windows Authentication for sql server. So i change the connection string in the apps config file and set Integrated Security=True. I run the app and the app starts up and correctly connects to the database. I click on a report from the menu.I loads the viewer and tries to run the report but it is unable to log in. I get the database login dailog box from Crystal Reports being displayed waiting for the proper login information..
Here is how i changed the code.
public void RetrieveAppSettings()
{
connectionInfo.ServerName = ConfigurationManager.AppSettings["DatabaseServer"];
connectionInfo.DatabaseName = ConfigurationManager.AppSettings["DatabaseName"];
connectionInfo.IntegratedSecurity = true;
// connectionInfo.UserID = ConfigurationManager.AppSettings["DatabaseUserName"];
// connectionInfo.Password = ConfigurationManager.AppSettings["DatabasePassword"];
reportServer = ConfigurationManager.AppSettings["UAReportServer"];
reportSource = reportServer + "/" + reportName + "Service.asmx";
}
What am i missing here? What datasource type do i have to use, ADO,Net, SQLOLEDB, SQL Native client?
Bill