ASP.NET Connection String!
Dear Sir:
I want to set ASP.NET common Connection String,
but in ASP.NET, there are no component like「environmentSettingsã€,
so how can i set it?
Thank you!
EX:
private void environmentSettings1_DatabaseLogin(object sender, DatabaseLoginEventArgs e)
{
e.ConnectionString = CONN;
}
I want to set ASP.NET common Connection String,
but in ASP.NET, there are no component like「environmentSettingsã€,
so how can i set it?
Thank you!
EX:
private void environmentSettings1_DatabaseLogin(object sender, DatabaseLoginEventArgs e)
{
e.ConnectionString = CONN;
}
Comments
Dear Sir:
Where can i post thses code?
in [ Page_load] ?
and in [ FastReport.Utils.Config ] there are no [DatabaseLogin]
so compiler fail!
FastReport.Utils.Config.ReportSettings.DatabaseLogin += ...
You may call this code in the Page.Load event, but it is better to change the connection string in the WebReport.StartReport event:
WebReport1.Report.Dictionary.Connections[0].ConnectionString = CONN;
In this case, you don't need DatabaseLogin event.
The second option cannot work, at StartReport event WebReport1.Report.Dictionary has no Connection.
But the first option mentioned in previous post on DatabaseLogin event is OK.
Robert