Connection

I'm trying to change the connection string at run time this way:

private void calllogEnvsettings_DatabaseLogin(object sender, DatabaseLoginEventArgs e)
{
e.Connection.ConnectionString = my_connectionString;
}

But the report displays with the connection string within the Report file, not the new one? Do I have to set any thing in the report?? This is the full code;

private void button1_Click(object sender, EventArgs e)
{
string connectionString = "Connection string here..."; //I pass the correct connection here.
report1.Load("myreport.frx"); //load the report
report1.Show();
}

private void calllogEnvsettings_DatabaseLogin(object sender, DatabaseLoginEventArgs e)
{
e.Connection.ConnectionString = my_connectionString;
}

Is there is anything wrong here??

Comments

  • edited 6:30AM
    Hello,

    That's my mistake, I will fix it in the next build. I've change the logic a bit, so you will need to change your code:
    e.ConnectionString = my_connectionString;
  • edited 6:30AM
    Thanks,

    When is the next build? or can I use (e.ConnectionString) now with the current build?

    Thank you.
  • edited 6:30AM
    The next build will be available in this midnight.
  • edited 6:30AM
    Thank you very much,

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.