Connection/data source from local SQL Server
Connection/data source from local SQL Server
I am a novice in working with Stimulsoft and SQL but so far so good, have made some great reports so far.
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!
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!
-
- Posts: 6337
- Joined: Tue Mar 20, 2018 5:34 am
Re: Connection/data source from local SQL Server
Hello,
For different formats, you should use different connections - SQL, MS Access, XML etc
Thank you.
For different formats, you should use different connections - SQL, MS Access, XML etc
Thank you.
-
- Posts: 1
- Joined: Mon Aug 26, 2019 8:07 pm
- Location: Egypt
Connection/data source from local SQL Server
I have a preexisting crystal report and I used an editor to pull out the SQL code. I cannot simply use that code in Microsoft SQL Server Management Studio 17 without modifying it. unfortunately, the code is more complicated than what I am used to working with and I would like some assistance.
Code from crystal report:
Code:
Code from crystal report:
Code:
Re: Connection/data source from local SQL Server
Hello,
What code are you using?
Thank you.
What code are you using?
Thank you.
SQL Connection String
Hi everyone...
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?
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?
-
- Posts: 6337
- Joined: Tue Mar 20, 2018 5:34 am
Re: Connection/data source from local SQL Server
Hello,
You can use the following code:
((StiSqlDatabase)report.Dictionary.Databases[ "ConnectionName"]).ConnectionString = "";
Thank you.
You can use the following code:
((StiSqlDatabase)report.Dictionary.Databases[ "ConnectionName"]).ConnectionString = "";
Thank you.
Re: Connection/data source from local SQL Server
Thanks for your answer
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;
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;
-
- Posts: 6337
- Joined: Tue Mar 20, 2018 5:34 am
Re: Connection/data source from local SQL Server
Hello,
You should use correct connection string:
Please check
Server=.\SQLExpress;AttachDbFilename=C:\MyFolder\MyDataFile.mdf;Database=dbname;Trusted_Connection=Yes;
https://www.connectionstrings.com/sql-server/
Thank you.
You should use correct connection string:
Please check
Server=.\SQLExpress;AttachDbFilename=C:\MyFolder\MyDataFile.mdf;Database=dbname;Trusted_Connection=Yes;
https://www.connectionstrings.com/sql-server/
Thank you.