|
-
Jul 1st, 2003, 10:44 PM
#1
Thread Starter
Junior Member
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
-
Jul 2nd, 2003, 12:57 AM
#2
You can just set the datasource to nothing.
VB Code:
DataGrid1.DataSource=Nothing
-
Jul 2nd, 2003, 08:40 PM
#3
Thread Starter
Junior Member
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
-
Jul 2nd, 2003, 09:23 PM
#4
Frenzied Member
dataGrid.DataSource = nothing should work.
BTW get rid of the ADO code, and start learning ADO.NET
-
Jul 3rd, 2003, 12:18 AM
#5
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|