|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Clearing data from a DataGridI've got to be missing something very simple here, but I'm stumped. I have a
DataGrid control on a form. The form allows search of a database and display of resulting rows in the DataGrid. My problem is, when the user does a second search, the results of the first search remain in the DataGrid, and the results of the second search are just added below. I've tried setting the DataSource property to Nothing and refreshing the DataGrid, but it doesn't seem to do anything. Any help would be appreciated. Thanks! Hi,
Are you clearing the dataset before you refill it? Ken ---------- Show quoteHide quote "DaveP" <Da***@discussions.microsoft.com> wrote in message news:4EE2BFDC-3B75-4F26-968A-A49CAB1D5334@microsoft.com... > I've got to be missing something very simple here, but I'm stumped. I > have a > DataGrid control on a form. The form allows search of a database and > display > of resulting rows in the DataGrid. > > My problem is, when the user does a second search, the results of the > first > search remain in the DataGrid, and the results of the second search are > just > added below. I've tried setting the DataSource property to Nothing and > refreshing the DataGrid, but it doesn't seem to do anything. > > Any help would be appreciated. > > Thanks! Thanks Ken. You got it exactly right. I realized I wasn't doing that, and
just came out here to "rescind" my question. Thanks for taking the time to answer. Show quoteHide quote "Ken Tucker [MVP]" wrote: > Hi, > > Are you clearing the dataset before you refill it? > > Ken > ---------- > "DaveP" <Da***@discussions.microsoft.com> wrote in message > news:4EE2BFDC-3B75-4F26-968A-A49CAB1D5334@microsoft.com... > > I've got to be missing something very simple here, but I'm stumped. I > > have a > > DataGrid control on a form. The form allows search of a database and > > display > > of resulting rows in the DataGrid. > > > > My problem is, when the user does a second search, the results of the > > first > > search remain in the DataGrid, and the results of the second search are > > just > > added below. I've tried setting the DataSource property to Nothing and > > refreshing the DataGrid, but it doesn't seem to do anything. > > > > Any help would be appreciated. > > > > Thanks! > > >
Option Strict On
disabling controls by checking off a radio button when the form loads Can't close EXCEL from my VB.NET application Passing a Variable from one web site to another for ASP ContainsFocus equivalent in VB SENDMail Use active directory to scan for software on a remote system? Get Memory Usage of my Program How do i do this in VB .Net All VB.NET eBOOKS |
|||||||||||||||||||||||