Skip to main content

Search

Search

How To Set A Sql Statement To Labelformatdocument Object?

Comments

2 comments

  • Avatar
    Domingo Rodriguez
    Moderator

    From BarTender's Help, you can see the instructions needed for compiling your first .NET SDK application:

     

    Beginning a Visual Studio Project with the Print SDK

     

    To begin a BarTender Print SDK project in Visual Studio 2005 or higher:

     



    1. From the File menu, select New and click
      Project.


    2. In the Project types panel, under either the Visual
      C#
      or the Visual Basic node, select Windows.


    3. In the Templates panel, select Windows
      Application
      .


    4. Name the project and click OK.

     

    After the project is created, add a reference to
    Seagull.BarTender.Print.

     



    1. In the Solution Explorer panel, right-click
      on the References node and select Add
      Reference
      from the context menu.


    2. In the Add Reference window, select the
      .NET tab, select Seagull.BarTender.Print, and
      click OK.

     

    Make sure the project is able to build and compile by pressing
    Ctrl+Shift+B. If successful, you are ready to begin your first
    BarTender Print SDK project.

     

    You could now set your OLEDB statement by using the following code (for C#.Net):

     

    string SQL = "SELECT `Calories` FROM `NutritionInformation`";

    Engine btEngine = new Engine();

    LabelFormatDocument btFormat = btEngine.Documents.Open(@"C:\NutritionLabel.btw");

    ((OLEDB)btFormat.DatabaseConnections[0]).SQLStatement = SQL;

     

     

    Does this help or will you still be stuck?

    0
  • Avatar
    Legacy Poster

    I found must add reference the namespace "Seagull.BarTender.Print.Database" ( NOT the "Seagull.BarTender.Print") so that to find the "OLEDB" class. 

     

    Thank you for you help~~!!

    0

Please sign in to leave a comment.