LINQ - Raj Kaimal

Browse by Tags

All Tags » LINQ (RSS)

LINQ to SQL Paging Gotcha

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode...
Posted by rajbk | 3 comment(s)
Filed under: , ,

FormView Binding Gotcha

Version: ASP.NET 3.5 SP1 When performing two way databinding, Null values and Nullables get changed to string.Empty in the FormView. The way the FormView control handles null values has caused me some grief :-( Consider a FormView bound to an ObjectDataSource...
Posted by rajbk | 1 comment(s)
Filed under: , ,

Uploading an Excel file to SQL through an ASP.NET webform

The method below describes how to upload a file to a webserver and then import the file into SQL using either LinqToSQL or SQL Bulk Copy. The sample code only shows how to import xls and xlsx files but it could easily be extended to support csv files...
Posted by rajbk | 3 comment(s)
Filed under: , , ,

Loading an XML file in your Silverlight project into memory

Version : Silverlight 2 Beta 2 Reading an XML file in an XAP package can easily be done with the help of a helper class like so: 1: public static class XmlHelper 2: { 3: public static XElement LoadDocument( string fileName) 4: { 5: //No longer required...
Posted by rajbk | 3 comment(s)
Filed under: , , ,

Connection strings in LINQ to SQL classes.

Version : VS 2008 RTW When you have a team working on a project that contains a LINQ to SQL class (dbml), you might see the following message when trying to add a Table entity or stored procedure in a dbml created by a fellow developer: The objects you...
Posted by rajbk | 5 comment(s)
Filed under: , ,

LinqDataSource exceptions

Prerequisite: LinqDataSource & SqlDataSource Master/Details When working with the LinqDataSource, you may get the exceptions listed below. 1. Operator '==' incompatible with operand types 'Int32' and 'Object' The exception occurs because anytime a...
Posted by rajbk | 7 comment(s)
Filed under: , ,

Building an RSS feed using LINQ to XML and LINQ to SQL

Version : VS 2008 Beta 2 In this post, I am going to show you how to build a RSS feed of the employees in the NorthWind database using LINQ. Before you proceed, you may want to read Scott's introduction of LINQ to XML over here if you haven't done so...
Posted by rajbk | 1 comment(s)
Filed under: , , ,

Using the ListView in tiled mode (Part 2) - CSS layout

Using the ListView in tiled mode (Part 1) Updated 12/01/2007 for VS 2008 RTM In this second part of my post on customizing the ListView UI, we are going to look at how to consume a Flickr RSS feed and display the feed items in a ListView (tiled mode)...
Posted by rajbk | 5 comment(s)
Filed under: ,

LinqDataSouce - DataItem in code behind

Version : Visual Studio 2008 Beta 2 The following examples shows how to use the GridViewRow.DataItem property to retrieve a property of the underlying object to which the GridViewRow is bound when using the LinqDataSource control. I have a GridView whose...
Posted by rajbk | 9 comment(s)
Filed under: , ,

Dynamic String based Queries in LINQ - Dynamic Expression API

Version: Visual Studio 2008 Beta 2 The Dynamic Expression API extends the core LINQ API with the ability to dynamically create string based queries that are constructed at run-time. The API provides Dynamic parsing of strings to produce expression trees...
Posted by rajbk | 12 comment(s)
Filed under: , ,
More Posts