Coffeehouse Thread

8 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

How can I do to create ActiveX Control in Visual Studio.

Back to Forum: Coffeehouse
  • User profile image
    renatojoaqu​imdutra

    Please, good evening, somewhere knows How can I do to create a ActiveX control in C# with Visual Studio?

    I need to check a SQL DataBase and after I need show the data in DataGridView.

  • User profile image
    Sven Groot

    @renatojoaquimdutra: Is this ActiveX control for use on web pages? If so, you probably shouldn't be using ActiveX controls unless there's absolutely no other way to do what you're doing, and even then developing them with .Net is a really bad idea.

    If this is not meant for the web, maybe it would help if you try to explain more what you're doing so we can offer more specific help.

  • User profile image
    spivonious

    @renatojoaquimdutra: You don't. VB6 was the last IDE that supported creating ActiveX controls.

    But what you want can easily be done using .NET. Windows Forms or WPF on the desktop; Web Forms or MVC in the browser.

    There also exists an Interop Toolkit from Microsoft that adds some project templates for you to expose your .NET forms and controls to COM. We use that at my company to host .NET controls inside of a VB6 MDI application.

  • User profile image
    blowdart

    , spivonious wrote

    @renatojoaquimdutra: You don't. VB6 was the last IDE that supported creating ActiveX controls.

    Not true - you can quite happily create COM objects and ActiveX objects in VS2010, via MFC and C++. You can even do it in 2012.

  • User profile image
    renatojoaqu​imdutra

    @Sven Groot: So, I work with industrial automation and I use a supervisory software. This software allows to use the ActiveX to connect with SQL Database. I would like to do a activeX in C Sharp using Visual Studio, in this ActiveX I would like to do a query in SQL database with filter for date (for example). I'm studying a lot of books about Visual Studio and CSharp but I don't know How can I do to create the activeX in Visual Studio. I was studying ADO.NET class because has a things about database connection.

  • User profile image
    spivonious

    , blowdart wrote

    *snip*

    Not true - you can quite happily create COM objects and ActiveX objects in VS2010, via MFC and C++. You can even do it in 2012.

    Of course you're correct. I have VB on the brain. Smiley

    @renatojoaquimdutra:

    C# does not support ActiveX directly. Try out the Interop Forms Toolkit. http://www.codeproject.com/Articles/18954/Interop-Forms-Toolkit-2-0-Tutorial

  • User profile image
    figuerres

    , renatojoaqu​imdutra wrote

    @Sven Groot: So, I work with industrial automation and I use a supervisory software. This software allows to use the ActiveX to connect with SQL Database. I would like to do a activeX in C Sharp using Visual Studio, in this ActiveX I would like to do a query in SQL database with filter for date (for example). I'm studying a lot of books about Visual Studio and CSharp but I don't know How can I do to create the activeX in Visual Studio. I was studying ADO.NET class because has a things about database connection.

     

    do they support any other way to connect to a data source ??

    AX just to do that seems like a not very good way to do it.

     

  • User profile image
    DCMonkey

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.