CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2008
    Posts
    40

    SQL query in VC++

    I would like to use SQL query on a label click and I don't know how. So could anyone please post the code for me? I am using VC++ WinCLR.

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: SQL query in VC++

    Some info on the database you are using/going to use would be nice.

  3. #3
    Join Date
    Feb 2008
    Posts
    40

    Re: SQL query in VC++

    I'm using database made in SQL Server 2005.

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: SQL query in VC++

    I don't know what WinCLR is, but you could look into CRecordset if MFC is involved.

  5. #5
    Join Date
    Feb 2008
    Posts
    40

    Re: SQL query in VC++

    No, I'm making CLR Windows Forms Application.

  6. #6
    Join Date
    Apr 1999
    Posts
    27,449

    Re: SQL query in VC++

    Quote Originally Posted by usingnamespace
    No, I'm making CLR Windows Forms Application.
    Sorry, this forum is for traditional C++ programming, not managed C++.

    Unless what you have deals with non-managed C++, you should ask your question in the Managed C++ forum.

    Regards,

    Paul McKenzie

  7. #7
    Join Date
    Feb 2008
    Posts
    40

    Re: SQL query in VC++

    OK, I will ask it there, but i doubt i will get any answers.

  8. #8
    Join Date
    Apr 1999
    Posts
    27,449

    Re: SQL query in VC++

    Quote Originally Posted by usingnamespace
    OK, I will ask it there, but i doubt i will get any answers.
    Forums were created for a reason. Please respect those reasons.

    Regards,

    Paul McKenzie

  9. #9
    Join Date
    Feb 2008
    Posts
    40

    Re: SQL query in VC++

    Yes I know, but i wasn't sure if it was managed or unmanaged. Now I have read about differences between them.

  10. #10
    Join Date
    Apr 1999
    Posts
    27,449

    Re: SQL query in VC++

    Quote Originally Posted by usingnamespace
    Yes I know, but i wasn't sure if it was managed or unmanaged. Now I have read about differences between them.
    There is a general answer to your question, or if not an answer, a way for you to ask the question with a little more detail:

    1) Do you know how to write code (regardless of the language) that is called when the Label is clicked? If not, then write that first. It doesn't matter what happens when the Label is clicked, just write the program to do that.

    2) Once you get 1) done, do you know how to code an SQL Query? If not, then first learn how to code a query, regardless of whether a button is pressed.

    Once you get 1) and 2), then you put the pieces of the puzzle together. Which one are you having trouble with, 1 or 2 or something else?

    That is how you should have proceeded asking the question on the correct forum. Detail exactly what you can't do or have trouble doing.

    Regards,

    Paul McKenzie

  11. #11
    Join Date
    Sep 2001
    Location
    Québec, Canada
    Posts
    1,923

    Re: SQL query in VC++

    This thread is now in the Managed C++ and C++/CLI forum.

    JeffB
    CodeGuru VB FAQ Visual Basic Frequently Asked Questions
    VB Code color Tool to color your VB code on CodeGuru
    Before you post Importants informations to know before posting

  12. #12
    Join Date
    Feb 2008
    Posts
    40

    Re: SQL query in VC++

    Quote Originally Posted by Paul McKenzie
    There is a general answer to your question, or if not an answer, a way for you to ask the question with a little more detail:

    1) Do you know how to write code (regardless of the language) that is called when the Label is clicked? If not, then write that first. It doesn't matter what happens when the Label is clicked, just write the program to do that.

    2) Once you get 1) done, do you know how to code an SQL Query? If not, then first learn how to code a query, regardless of whether a button is pressed.

    Once you get 1) and 2), then you put the pieces of the puzzle together. Which one are you having trouble with, 1 or 2 or something else?

    That is how you should have proceeded asking the question on the correct forum. Detail exactly what you can't do or have trouble doing.

    Regards,

    Paul McKenzie
    I know both 1) and 2). When I click on a label i want that information from specific query is outputed to some other control.

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

Featured