Hi All,
We have a datatable that is bound to a calendarinfo instance with a dayview control on the form. When we add, modify or delete an Appointment we launch AppointmentsTableAdapter.Update, but other network users do not see the changes. I tried to use the DataBindingsForAppointments.RefreshData method, but I do not see the changes. The only method that we can see changes is to repeat every 5 minutes AppointmentsTableAdapter.Fill, but if there are many records this method takes a long time and lowers the performance.
How can I resolve this?
Regards, Lello
aaronglover said:You can't be serious Lello! It would be near impossible for Infragistics to produce such functionality... it is completely out of scope and responsibility for the Infragistics to do so. there are many WELL DOCUMENTED processes to handle the problems associated with multi-user network environments and disconnected data objects.
The UltraCalendarInfo class is very special because centralizes all the date specific state information into a single component that can be referenced from all the UltraSchedule controls. The UltracalendarInfo class manages also the frequency of recurrences. For this reason it is not easy to manage the problems associated with multi-user network environments and disconnected data objects. If there are many records the method AppointmentsTableAdapter.Fill() reduces the performance. For this reason I would like to reload "from the database" only Appointments included in SelectedDateRanges but my problem is to handle the recurrences with a start date recurring series outside selected date range. No book on ADO.NET explains how to do this because UltraCalendarInfo is a special class created by Infragistics. Only Infragistics can solve the problem of propagating quickly appointments changes in a network environment.
Sorry for my English, but I use Google translator :-)
jurisquick said: I suggest to Infragistics to add a method that allow UltraCalenrarInfo to reload from a database only the records changed. Regards, Lello
I suggest to Infragistics to add a method that allow UltraCalenrarInfo to reload from a database only the records changed.
You can't be serious Lello! It would be near impossible for Infragistics to produce such functionality... it is completely out of scope and responsibility for the Infragistics to do so. there are many WELL DOCUMENTED processes to handle the problems associated with multi-user network environments and disconnected data objects.
jurisquick said:this is very complicated for an inexpert programmer
I suggest you do some training and read some books about ADO.NET. Perhaps if you gained some insight into the methods available you will realise why it is not reasonable to expect Infragistics to implement such functionality.
Brian Fallon said: 2) As mentioned in the quote (by David Hanson) that you referenced, you have to handle these things yourself. If you need to get the appointments within a certain range and you want to include recurrences, the query you use to get the appointments within the SelectedDateRanges will have to be modified to include recurrences. You might want to add a boolean column to the table that earmarks the appointments that are recurrences so that you can differentiate between them and regular appointments, and include records that have that field set to true in your query.
2) As mentioned in the quote (by David Hanson) that you referenced, you have to handle these things yourself. If you need to get the appointments within a certain range and you want to include recurrences, the query you use to get the appointments within the SelectedDateRanges will have to be modified to include recurrences. You might want to add a boolean column to the table that earmarks the appointments that are recurrences so that you can differentiate between them and regular appointments, and include records that have that field set to true in your query.
Thanks for your reply but this is very complicated for an inexpert programmer. I suggest to Infragistics to add a method that allow UltraCalenrarInfo to reload from a database only the records changed.
1) Yes, that is correct. The RefreshData method is useulf in situations where the underlying DataSet has changed outside of the WinSchedule binding, and you want to synchronize with those changes. The "data source" referenced here, however, is typically a DataSet, not a database.
David Hanson said: The DataSet is a disconnected object and will not be automaticallysynchronized with the data on the actual database server after it has beenoriginalled filled with information.If you truly need to maintain an up-to-date copy of the information on theclient at all times you will have to write custom code to handle thatrequirement. Here are a few thoughts on how you might approach this: Create a new table in your database called "TableLastModified" and add a column called "TableName" and a column called "LastModifiedOn". The "TableName" field should be char/varchar and should contain the name of the table you want to track. The "LastModifiedOn" column should be DateTime and should store the date/time you last modified data for the table in question. You will need to modify any code the information in the tables to update this new "TableLastModified" table after each change; Populate your dataset on the client and record the date/time you populated it in a variable; Place a timer on your Window's client form and have it fire an event every XX seconds. Have the code in the event check the appropriate record in the "TableLastModified" table to see when the information for the table was last modified. If the value is more recent then the value you have stored in your variable then reload the dataset and update the value of your variable.
The DataSet is a disconnected object and will not be automaticallysynchronized with the data on the actual database server after it has beenoriginalled filled with information.If you truly need to maintain an up-to-date copy of the information on theclient at all times you will have to write custom code to handle thatrequirement. Here are a few thoughts on how you might approach this:
Instead to reload entire AppointmentsTableAdapter (the method Fill() greatly reduces the performance) there's a way to reload only Appointments included in SelectedDateRanges?
My problem is to reload recurrences with a start date recurring series outside selected date range!
Thanks for the help, Lello