locked
How to generate a DBML image file (jpg, png, etc...) without launching VS (in other words, automated), using C#?? RRS feed

  • Question

  • I'd like to reach into a project, any project type that contains a DBML file, and generate an image (the same image generated by the DBML design surface editor) of that file and save it out to a JPG or TIFF or PNG, etc...
    I've seen this: http://blogs.msdn.com/b/camerons/archive/2010/03/08/save-a-diagram-to-image-file.aspx 
    But if I understand that correctly, that just adds a menu item so you can save the DBML as a file, manual intervention necessary and I want to perform this completely automated.
    The other sample I saw was for generating images but from a specific project type in VS 10. I need to do this for any DBML in any project type.
    Is this possible, can anyone point me to some sample code?

    --ACG
    • Edited by ACG Thursday, December 8, 2011 2:33 PM
    • Moved by Blair McG Monday, December 12, 2011 11:55 AM Question about DBML (From:Visual Studio Visualization & Modeling SDK (DSL Tools))
    Thursday, December 8, 2011 2:32 PM

Answers

All replies

  • I think you can try the tool: SqlMetal.exe http://msdn.microsoft.com/en-us/library/bb386987.aspx

     


    I am fish.
    Tuesday, December 13, 2011 9:23 AM
  • Thanks for your reply but this only seems to output codefiles, excerpt from the page:

    "By using the appropriate command-line options, you can produce Visual Basic or C# source code, or you can produce an XML mapping file."

    What I need is the image (picture) of the  DBML.

    Thanks!


    --ACG
    Tuesday, December 13, 2011 6:02 PM
  • Hi ACG,

    Welcome!

    I think you can use the link in your post, you can refer this link: http://msdn.microsoft.com/en-us/library/ff469815.aspx

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, December 14, 2011 7:56 AM
  • Thanks for your reply! What I need is a way to this from a command line, the solution in that webpage is a to add a button to VS. I do not want to launch an instance VS or at least an interface, I want to call something that will generate the image for me from a command line. Is this possible? By the way, again, sqlmetal does not do it.

     

    I haven't found anything that does this out there, no 3rd party or open source. Is it possible that nothing can do what I need?


    --ACG
    Saturday, December 17, 2011 5:13 PM
  • Hi ACG,

    Based on my knowledge, it seems there is no way to chieve your goal. Thanks for understanding.

    BTW, I think you can try here: http://social.msdn.microsoft.com/Forums/en-us/category/vsarch

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Alan_chen Thursday, December 29, 2011 6:40 AM
    Tuesday, December 20, 2011 6:20 AM