Results 1 to 5 of 5

Thread: DataGrid

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    28

    Unhappy DataGrid

    Hi All,
    I am new to VB .NET and i need ur advise on this ( i know this is an idiot question but i appreciate it someone can help )
    HOW to Clear the records inside of a datagrid ?

    TIA

    regadrs
    Jas

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can just set the datasource to nothing.
    VB Code:
    1. DataGrid1.DataSource=Nothing

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    28

    Re: DAtagrid

    i have try that datagrid.datasource=nothing but it's still cannt work.

    below are my sample .net code
    da.Dispose()
    ds.Dispose()
    'dgdResource.Refresh()

    TmpRs = New ADODB.Recordset

    TmpRs.Open(TmpStrSQL, gclsAdoDatabase.cnDatabase, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
    If Not TmpRs.EOF Then
    dgdResource.Enabled = True
    da.Fill(ds, TmpRs, "list")

    dgdResource.DataSource = ds
    dgdResource.DataMember = "list"
    dgdResource.Refresh()
    Else
    dgdResource.Enabled = False
    End If


    TIA

  4. #4
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    dataGrid.DataSource = nothing should work.

    BTW get rid of the ADO code, and start learning ADO.NET

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Posts
    28

    DataGrid (REsolved)

    thx,,will take ur advise learned ado.net

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