Results 1 to 4 of 4

Thread: [3.0/LINQ] embed a class in a user control

  1. #1

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    [3.0/LINQ] embed a class in a user control

    I have recently taken up the idea of makeing user Controls for things that i use quiet often.

    One user control i have created is a datagridview , load button and a save button, for editing csv files that we use quiet frequently at work.


    on save is use a class called WriteCSV to save the data. I can add the class to the project no problem but to increase the portablity of the user control is there a way that i can add the class directly to the user control so that i (or another coworker) dont have to remember to add the class WriteCSV.cs as well as CsvDisplay.cs as well?


    Thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [3.0/LINQ] embed a class in a user control

    Why would you have to add either? Both those classes should be compiled into their own DLLs. If you want to use that UC you reference the library it's defined in and away you go, just like any other control. Note that, if you add a control to a form from the Toolbox, the required reference will be added to your project automatically.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    Re: [3.0/LINQ] embed a class in a user control

    If i created a user control as a dll. and then the class as a dll

    when i created a new project i would have to make sure thouse two files were present with the exe?
    (when i deploy it)

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [3.0/LINQ] embed a class in a user control

    Quote Originally Posted by Crash893
    If i created a user control as a dll. and then the class as a dll

    when i created a new project i would have to make sure thouse two files were present with the exe?
    (when i deploy it)
    If your issue is deploying more than one file then either use IExpress, which is part of Windows, to create a self-extracting executable or else use ILMerge, which you can download from Microsoft, to merge the assemblies into one. That way you develop with multiple assemblies and then simply create a single file for deployment when you're done. The difference is that with ILMerge you're creating a single assembly where IExpress will create a file that will extract the multiple original assemblies.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width