2. March 2012 19:46
PetaPoco is a simple but fast tiny ORM. It is not a full-fledged ORM like NHibernate but a no-fuss easy implementation of ORM. It is a single C# file which you can attach in your project. You can even use NuGet to directly download and integrate it in your project.
PetaPoco has some interesting features like:
- Support for T4 templates to generate schema from POCO classes.
- Retrieve paged results automatically.
- SQL support. No need for strict Linq syntax.
- No external dependencies. Comes as a single C# file.
- Rather than using automatic mapping, you can use ExplicitColumns attribute to show only the columns to be mapped.
In this post I show you how to query a table using PetaPoco and how to bind a GridView with the result. As discussed above, here I prefer to use ExplicitMapping of table and individual column.
1. January 2012 12:14
I messed with this issue for about a month. I recently migrated an old ASP.NET 2.0 application on a private server with Windows 2008 Server R2 Enterprise OS installed. The application consists of few entry forms where date is to be entered in dd/mm/yyyy format. This application has a TextBox to enter the date and not a DateTime picker. Sometimes DateTime picker is not easy to work with when you need to enter old dates often and if you want to keep it null sometimes.
ASP.NET shows error: “Input String was not in a correct format” when date is entered in dd/mm/yyyy format. I re-checked SQL Server documentation, changed SQL Server’s default language for default login (though not recommended), but nothing seemed to solve the problem.
My last workaround with IIS Settings solved the issue.
I am using Windows Server 2008 R2 which comes with IIS 7. Open IIS and right-click the virtual directory of your application.
19. December 2011 21:34
With this article, I am starting a small series of tips and tricks to handle few irritating issues of Crystal Reports. This post covers a couple of issues:
Issue 1: Crystal Report Viewer's Print and Export button not working.
Solution: This is a bug which is addressed by Crystal Reports Service Packs. If you are using Crystal Reports from within Visual Studio, you need to download Crystal Reports for Visual Studio service pack. There are a couple of Hot Fixes and Security Updates released to patch further issues:
6. May 2011 16:50
In an ASP.NET application, making JQuery work with a Master Page and Web Content Form is often a matter of confusion for beginners. Since the Web Content Form doesn't have a HTML HEAD section, novice programmers often get baffled on where to put references to JQuery necessary files and CSS files.
Below I show you how simply you can make JQuery work in an application with a Master Page and a Web Content Form. To make this example work, you need to download few files and add their references to your Visual Studio project. This example uses Visual Studio 2008 with .NET Framework 3.5 SP1.
JQuery core file needed
You can download this file from JQueryUI website.
JQuery DatePicker plugin
I am taking a JQuery DatePicker plugin from Keith Wood's blog.
A DatePicker can easily be added as a popup to a text field or inline in a division or span with appropriate default settings. The popup shows when the field gains focus and is closed by clicking on the Close link or clicking anywhere else on the page. You can also remove the DatePicker widget if it is no longer required.
We need two files of this plugin to display a simple DatePicker:
To start with:
- Create a simple ASP.NET website using Visual Studio. As I said before, I am using Visual Studio 2008 for this example. (You can try this example with the latest version as well, but I have not tested this example on the latest version.)
- Add a Master Page [In this example it is named: Master1.master]
- Add a Web Content Form. Don't forget to link it up with the Master Page, Master1.master, we added above.
This is how the Solution Explorer on my desktop looks like: