Oct
21
ASP.NET MVC Beta now available
October 21, 2008 | Leave a Comment
Microsoft have now released the Beta Download of ASP.NET MVC which allows developers to use the Model-View-Controller Framework on ASP.NET 3.5 .
The download can be found here.
I will confess that I have never used the MVC model in my web development, but InfoQ have a good article on it here.
Microsoft’s MVC framework trades in the quick development time of forms and controls for the flexibility and precision you get from controlling all the HTML output directly. This change in philosophy will probably be a much easier transition for those familiar to classic ASP programmers or non-Microsoft languages than those already with a background in .NET programming.
Scott Guthrie has lots of background as well here.
All my code is still based on .NET 2.0, so I cannot use it yet. Once I get my current development issues resolved, I fully intend to upgrade to .NET 3.5 and start looking into all the new technology around.Â
Oct
14
Write your own Replicayshun!!
October 14, 2008 | Leave a Comment
Yes, I do know that it is Replication, it was a deliberate error!!
Well, I have been pretty busy on the orders of battle front for the last couple of weeks looking into and implementing a new system to replicate changes from my local database which runs on my client machine here in Germany with my server database in Canada which powers my website www.ordersofbattle.com .
Regular readers of this blog will know that Merge Replication just stopped working for me and I have not been able to get in working again so I have been looking around for alternatives.
Basically I want all inserts, updates and deletes made to to a certain group of tables on my client database to be applied automatically to my server database.
Inserts and Updates are not so much of a problem but Deletes are because the record disappears from the database so you cannot just get a list of recent record changes and send those records to the server for example (which is something I wrote about 5 years ago when I was experimenting with using MSMQ) because (obviously) deleted records do not show up. Â
I considered using Service Broker which comes with SQL Server but it is closely tied to SQL Server and I wanted something a little less propietary. I was also not sure how difficult it would be to handle messages across HTTP. I think it can handle sending messages to databases via HTTP, but I did not get round to trying it.
In the end, I decided to roll my own solution and dug out my old MSMQ console applications from 5 years ago and rewrote them to handle my new requirements.
Basically, I decided to capture the changes before they were written to the client database so that would handle deletes and write XML from the ADO.NET dataset to a local MSMQ Queue on the client machine. This means that both databases must always be in sync so that the same keys are applied when the records are saved to the database(s).
MSMQ (or another Queueing system) is necessary so that changes are processed in the order in which they happen on the client machine.
Once the XML message is on the Queue, a .NET console application can run via the Windows Scheduler to write it to a file, FTP it to the server machine where it can be placed on a inbould Queue and then read into a ADO.NET dataset and applied on the Server database.
So far, it is all working fine but I have a problem with deletes of records in subordinate tables which are handled as part of an update of the parent record. Basically it is not working because the XML I am writing does not contain any infoprmation on the deleted record.
I am generating that XML using the GetXML method on the dataset. I am going to try using WriteXML instead to generate a Diffgram Dataset and see if that works. If that does not work, I can write code in the Save method of the subordinate table classes to generate a message which would trigger a delete of the child record in the server database.
So, we are almost there!

