CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: vb and sql

  1. #1
    Join Date
    Nov 2005
    Posts
    20

    Unhappy vb and sql

    hi there...

    i need to catch data fro sql database every 1 minute to the vb form....i know i have to use timer but i really dunno do to do......do anyone have the source code.....help me......

  2. #2
    Join Date
    Dec 2004
    Posts
    423

    Re: vb and sql

    Which version of VB and SQL do you have?

    Which controls on the form are you repopulating?

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: vb and sql

    Need a bit more info!

  4. #4
    Join Date
    Nov 2005
    Posts
    20

    Re: vb and sql

    I’m using visual basic 6 and sql server 2000…need to catch data from sql every 1 minute to vb form and assign it to chart(charttype2dbar).. how do i do that.....i need to use timer but i dunno how to fetch the data every 1 minute........can anyone help me... do anyone have the source code

  5. #5
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: vb and sql

    Here is how you do it.
    Put a timer control on the Form. Set the Interval property of the timer control to 60000 (Approximately 1 minute). In the Timer Event write the code for retrieving data. For example, Open a recordset using the query and then populate it wehere ever you want.

    The timer event will always file every 1 minute and will retrieve the data from the database.

  6. #6
    Join Date
    Nov 2005
    Posts
    20

    Unhappy Re: vb and sql

    one more question...

    in my database table.... i have stored few data's....... and the data is yes and no....... now there are 4 data with yes... how do i count this data...using sql command statement....and assign it to the chart... i've tried but i couldnt.... please help me

  7. #7
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: vb and sql

    You could use the SQL Count function, if I'm not mistaken

  8. #8
    Join Date
    Sep 2005
    Location
    Delhi, INDIA
    Posts
    237

    Re: vb and sql

    Quote Originally Posted by HanneSThEGreaT
    You could use the SQL Count function, if I'm not mistaken
    I Agree with your Hannes..!

    Like this ;

    "Select count(at_Yes) as CntOfYes from YOUR_TABLE_NAME"

    then use CntOfyes field to retrieve the Count Value for Yes type of Records... and same for No type of Data.
    I'M BACK AGAIN !!
    -------------------------------------------------------------------------
    enjoy the VB !
    If any post helps you, please rate that.
    Always try to findout the Solutions, instead just discussing the problem and its scope!

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