Am trying to add a second data source to a report and this second data source is located on my local workstation currently. I have the data in several different formats just trying to get something to work -- it is originally a dBase file, have it as a SQL mdf, Access mdb file, an Excel file, xml. But no matter what connection type and string I try I cannot get connected to this local data.
Should I be able to add this local data source? And which connection type and string would be best?
Thank you, all!
For different formats, you should use different connections - SQL, MS Access, XML etc
Code from crystal report:
What code are you using?
I have made my WPF project reports by stimulsoft reports with this SQL server connection string (Data Source=.;Initial Catalog=DBNBO;Integrated Security=True;),
I want to make a setup file for my project by Advanced Installer program for this purpose I have transferred my database to SQLExpress and I have moved mdf and ldf file to my debug project file. I need to change reports sql connection string in stimulsoft reports so that it can execute correctly; but I don't know how to do this.
Can anybody help me, please?
You can use the following code:
((StiSqlDatabase)report.Dictionary.Databases[ "ConnectionName"]).ConnectionString = "";
As you see below the first one is the connection string I used in WPF c#, and the other one I used in stimulsoft. it works correctly; but when I transfer my database from SQL server to SQL express and I move MDF and LDF files to debug folder of the project to create a setup file for it by advanced installer it doesn't work and it shows this error (Cannot open database "DBNBO" requested by the login. The login failed.Login failed for user 'NAWZAD\Nawzad'); I think I have to change (Data Source=.; ) to (Data Source=.\SQLExpress;); but what can I do for (Initial Catalog=DBNBO;)?
1- rptSentReport.Dictionary.Databases.Add(new StiSqlDatabase ("PublicSent", "Data Source=.;Initial Catalog=DBNBO;Integrated Security=True;"));
2- Data Source=.;Initial Catalog=DBNBO;Integrated Security=True;