my db connection has some specific purpose to use.
so i want the report use the same db connection in my application,not the same connection string.is the same connection object.
i try to extened the stisqldatabase ,to set the db connection object via the construct function,but when i run the report,it has a exception see that:" cant't find the namespace StiExtended". the StiExtended is my extended class's namespace.
how should i change my code to use the exist connection object ?
how to set the report database via exist dbconnection
Re: how to set the report database via exist dbconnection
i try to use the report.RegData("name",existConnection);
it will execute sql at the specific connection,but not show the correct data in report.
it will execute sql at the specific connection,but not show the correct data in report.
Re: how to set the report database via exist dbconnection
Hello,
Please try to use the following code for change connection string in the report:
((StiSqlDatabase)report.Dictionary.Databases["Connection"]).ConnectionString = ""
also you can add the new connection from code:
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", newConnectionString));
Thank you.
Please try to use the following code for change connection string in the report:
((StiSqlDatabase)report.Dictionary.Databases["Connection"]).ConnectionString = ""
also you can add the new connection from code:
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", newConnectionString));
Thank you.
Re: how to set the report database via exist dbconnection
thanks for reply.
i don't want to change the connection string. because if i change the connection string,it will create a new connection to the database.
i want to use the exist connection,but there is not function th set the connection direct.
i don't want to change the connection string. because if i change the connection string,it will create a new connection to the database.
i want to use the exist connection,but there is not function th set the connection direct.
Re: how to set the report database via exist dbconnection
Hello,
Unfortunately, it is not possible.
Let us know if you need any additional help.
Thank you.
Unfortunately, it is not possible.
Let us know if you need any additional help.
Thank you.