Insert functionality in GridView – Part 2

by rahul 7/10/2009 1:33:07 PM
In my previous post I have shown that if you have no records in your table and try to bind that table to a grid view, you will get nothing. Not even the header rows. To get rid of this issue, there is a very simple way. 1. Select Edit Templates 2. Switch over to EmptyDataTemplate 3. Drag and drop a Form View control and bind it to the same data source. 4. Change the Default Mode of this Form View to Insert and you should be good to go. And if this doesn’t suit your bill… “Code”. ... [More]


Missing Insert functionality in GridView – Part 1

by rahul 7/6/2009 4:52:28 AM
I have never been a very big fan of “drag and drop, do data binding… get your application up in no time, and rejoice” approach, but sometimes when I am really lazy I go that route too. So, today was that day… I had a very simple requirement. Let’s take a look at the two tables below… one is Course (Master) and the other one is CourseArticle (Detail). My requirement is to use LINQ and see how fast I can make the things work in ASP.NET. Approach 1 : Using GridView Step 1. Drag and drop Gri... [More]


System.InvalidOperationException: Sequence contains no elements

by rahul 3/26/2009 1:44:00 AM
While using LINQ, let’s say you decide to do something similar to the following… NorthWindDataContext dc = new NorthWindDataContext(); Product p = dc.Products.First(p1 => p1.ProductName.StartsWith("My New Product")); if (p == null) return; dc.Products.DeleteOnSubmit(p); dc.SubmitChanges(); ShowProducts(); Everything would be fine if you do have a product whose name starts with “My New Product”, but what do you think would happen if t... [More]


LINQ Performance - Part 1 - LINQ to Collection

by rahul 1/27/2009 7:18:23 AM
There are multiple benchmarking results already out there for LINQ. The reason why I am doing this again is the because I have heard multiple times that the latest version of LINQ contains a lot of improvements. My current configuration is... Windows Server 2008 Enterprise SP 1Visual Studio 2008 SP14GB RAM System.Core version 3.5.30729.1 In this post, I will take a look at the results ONLY from LINQ to Collection (An array of strings). You can play around with the code and post other findings (... [More]


Search


Tags



Categories

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

All Items
Sign in

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0