If you are developing web application, data validation is one of the major aspect while developing applications. ASP.Net MVC has defined a great approach for data validation using Data Annotations. One may have query that how can we implement our own custom validation which should act like data annotations. So here I am going to narrate how we can create custom validation in MVC using data annotations.
Sometimes you may need to read Excel file in c# and bind result in grid. Or you may need to store retrieved data into database. So here is the sample code which narrates how to read excel file in C#.
This code is able to read both extensions (.xls and .xlsx ) of excel file. Hope it will help you.
Unit testing is very important part of Software/Web development. Basically its a testable part of the application in which you can write unit test cases for each and every public classes and methods. Writing unit test cases means making sure that all part of the functionality development are working fine without any break. You can also do unit testing for private methods.
May be you have come across the situation that you need to convert some value to dynamically defined data type. But you don’t know the proper way to do it and you end this situation using switch case statements. But if you do it in a proper way than you do not need to use switch case statement and you can convert value to dynamic data type (more…)