how do i refresh datagrid control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vai
    New Member
    • Jul 2007
    • 5

    how do i refresh datagrid control

    i'm working in visual basic.
    i want to dispaly the records in a datagrid control who's
    data source is adodc.i want to display the records for a particular date.
    i.e. if the date which i accept from the user exists,then for that
    particular date all the records must be displayed.
    my problem is when i run my form all the records are displayed.
    the records ,which are in my access database table.
    so i set the following properties,

    Adodc1.CommandT ype = adCmdText
    Adodc1.RecordSo urce = "select * from invoice where Datein=" & Val(txtdate.Tex t)
    Adodc1.Refresh
    DataGrid1.Refre sh

    even then the above code doesn't work.
    how do i refresh datagrid control??
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by vai
    i'm working in visual basic.
    i want to dispaly the records in a datagrid control who's
    data source is adodc.i want to display the records for a particular date.
    i.e. if the date which i accept from the user exists,then for that
    particular date all the records must be displayed.
    my problem is when i run my form all the records are displayed.
    the records ,which are in my access database table.
    so i set the following properties,

    Adodc1.CommandT ype = adCmdText
    Adodc1.RecordSo urce = "select * from invoice where Datein=" & Val(txtdate.Tex t)
    Adodc1.Refresh
    DataGrid1.Refre sh

    even then the above code doesn't work.
    how do i refresh datagrid control??
    Good, But you never Initialize the datagrid to ADODC1.
    if it is not, then you have to fill that datagrid.

    Comment

    • vai
      New Member
      • Jul 2007
      • 5

      #3
      Originally posted by hariharanmca
      Good, But you never Initialize the datagrid to ADODC1.
      if it is not, then you have to fill that datagrid.
      i tried initializing the datagrid to ADODC1.
      but its not working.
      datagrid control is not refreshing.
      pls help me.

      Comment

      • fplesco
        New Member
        • Jul 2007
        • 82

        #4
        Originally posted by vai
        i tried initializing the datagrid to ADODC1.
        but its not working.
        datagrid control is not refreshing.
        pls help me.
        Hi -

        Is your datagrid control bind to ADODC1?

        Like
        Code:
        Set DataGrid1.Recordsource = Adodc1.Recordsource 'OR Recordset
        Well, Im not sure at those methods but you can try play on that.

        I'll try this at home and I'll get back to you once this is not yet solved.

        Comment

        • hariharanmca
          Top Contributor
          • Dec 2006
          • 1977

          #5
          Originally posted by vai
          i tried initializing the datagrid to ADODC1.
          but its not working.
          datagrid control is not refreshing.
          pls help me.

          can you post the code, how you bind the datagrid to your datagrid?

          Comment

          • vai
            New Member
            • Jul 2007
            • 5

            #6
            Originally posted by hariharanmca
            can you post the code, how you bind the datagrid to your datagrid?
            thanks a lot sir !!
            my code is working now.
            first of all i initialized DATAGRID control to ADODC.
            then i run my SQL Query.
            thanks once again.

            Comment

            Working...