DataSet

edited July 2011 in FastReport .NET
Hi Guys,

I've got a suite of vb.net programs which work against a SQL server database and they use Datasets specified in the Visual Studio project. The FastReport sections work fine off these datasets but i'm now faced with a problem.

This is all fine in a development environment but I want to shift to a production environment where the datasets, connection strings etc are not specified within the project. I've got the rest of the suite working fine but want to know how to use FastReports where your not showing up a dataset within the Visual studio dev but create one with code.

Anyone have any experience of this?

Thanks

Comments

  • edited 7:36AM
    BrianF wrote: »
    Hi Guys,

    I've got a suite of vb.net programs which work against a SQL server database and they use Datasets specified in the Visual Studio project. The FastReport sections work fine off these datasets but i'm now faced with a problem.

    This is all fine in a development environment but I want to shift to a production environment where the datasets, connection strings etc are not specified within the project. I've got the rest of the suite working fine but want to know how to use FastReports where your not showing up a dataset within the Visual studio dev but create one with code.

    Anyone have any experience of this?

    Thanks

    Hi BrianF
    You can find that somewhere but if you like answer here then try something like that:

    protected void WebReport_StartReport(object sender, EventArgs e)
    {
    var rConn = WebReport.Report.FindObject("Connection");
    if (rConn is MsSqlDataConnection)
    {
    ((MsSqlDataConnection) rConn).ConnectionString = db.ConnectionString;

    }
    }


    Where db is your db in project.

    Regards
    Daniel
  • edited 7:36AM

    Great post! It's very nice. Thank you so much for your post.

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.