I needed a method to calculate the number of working days between two specified dates. I scanned the internet and found a VBA example in the Microsoft knowledge base . I needed a C# version, so below is the converted code for those who are interested: long WorkingDays(DateTime beginDate, DateTime endDate...
public static bool IsNumeric ( object Expression ) { bool flag1 ; IConvertible convertible1 = null ; if ( Expression is IConvertible ) { convertible1 = ( IConvertible ) Expression ; } if ( convertible1 == null ) { if ( Expression is char []) { Expression = new string (( char []) Expression ); } else...
I haven't done anything with ASP.Net in the past year, but when a friend asked me if I could help him do something very simple I obviously jumped in to help him. So what was that simple task, you may wonder? Well, he needed a messagebox asking the user “Do you really want to delete this?”...
When you re-assign a datasource to your DataGrid, the selected row becomes the first row in the grid again. That can be very annoying when you just made changes to the last row and want to see if that's OK. So here's a solution. Pass in the DataGrid, the KeyValue for the row you want to set focus to...
In my current project we use type DataSets as a source for the reports we build using Crystal Reports for VS.Net. How this works can be found in the Crystal Reports knowledge base , and more specific in this document . One of the challenges there was to assign DataSets to the reports once it was created...
I decided to start posting code samples to help other developers. The first postings will be about DataGrid. The samples are used in the project I'm working on at this moment. Where in my grid did the user click? When you want to use the DoubleClick event to start some action on the selected item in...