|
-
September 19th, 2006, 02:58 AM
#1
Problems getting notification for DataGridView
How do you get automatic notification for a DataGridView so I don't have to poll and manually update the table data in the DataGridView. I've been searching the Internet for good examples but I haven't found any. I want the data to be changed automatically as soon as something happens in the database.
-
September 19th, 2006, 03:31 AM
#2
Re: Problems getting notification for DataGridView
What database are you using? If it is SQL Server 2005 then have look at the SqlDependency class. Otherwise I think you will need to do some polling, but this isn't too bad if it is done well.
-
September 19th, 2006, 03:57 AM
#3
Re: Problems getting notification for DataGridView
I'm using Mimer SQL. When I poll the VSB keeps scrolling to the top of the table.
Edit:-------------------------------------------------------------------------
Now I understand! You have to poll and update the data source (DataTable or DataView). There's no way for the datagrid to sense changes in the database unless you use that MS database. That's what I thought at first. But then they started to talk about list notifications and I got confused.
/Larra
Last edited by lagu2653; September 19th, 2006 at 03:40 PM.
Reason: Now I understand!
-
September 20th, 2006, 02:58 AM
#4
Re: Problems getting notification for DataGridView
Would forking a thread which updates the datasource every 5 seconds be a good way of doing it?
-
September 20th, 2006, 03:23 AM
#5
Re: Problems getting notification for DataGridView
Ideally you should create a thread that checks the database for updates and only updates the datasource if there have been changes. You may need to adjust the structure of the database to acheive this easily.
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
|