Page view counter

How Do I: LINQ to SQL: LinqDataSource

The new asp:LinqDataSource control .NET 3.5 makes binding to UI elements easy. In fact, no code was written or harmed in the making of this video. Query, update, delete, paging, sorting, all done through LINQ and the LinqDataSource.

Presented by Scott Stanfield

Duration: 11 minutes, 25 seconds

Date: 10 January 2008

Watch the video   |   Download the video   |   Get the code

Video downloads: WMV | Zune | iPod | PSP | MPEG-4 | 3GP

Audio downloads: AAC | WMA | MPEG-4 | MPEG-3 | MPEG-2

Comments : 15

Leave a Comment

neo302 : On March 07, 2008 12:18 AM said:

Great video Scott! You make some of the best videos. You are quick to the point, but not too quick.

xequence : On June 11, 2008 11:40 AM said:

Sweet video, almost a new way of querying the datasource without having to write one.

SteliosM : On June 16, 2008 3:32 AM said:

I tried to follow the steps of your video and I'm getting

"Operator '==' incompatible with operand types 'Int32' and 'Object' " when I try to view thw web page.

why?

vasireddybharath : On June 23, 2008 11:19 PM said:

Hi Scott,

    Thankyou for your videos. they are great....

thanks

Bharath VasiReddy

cv_vikram : On August 14, 2008 6:27 PM said:

thanks......

uthai : On August 20, 2008 6:05 AM said:

Hi Scott,

   Thankyou for videos , and i try for

using LinkPart5.Data;

public partial class _Default : System.Web.UI.Page

   {

       protected void Page_Load(object sender, EventArgs e)

       {

           //test

           NorthwindDataContext db= new NorthwindDataContext();

// error

Error 1 The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\Documents and Settings\Administrator\My Documents\msdn\Ling\code\LINQ to SQL Part 5 (CSharp)\LINQ to SQL Part 5 (CSharp)\LinkPart5.Web\Default.aspx.cs 22 13 LinkPart5.Web

       }

   }

:== ??  help me

thansyou

uthai : On August 20, 2008 6:05 AM said:

Hi Scott,

   Thankyou for videos , and i try for

using LinkPart5.Data;

public partial class _Default : System.Web.UI.Page

   {

       protected void Page_Load(object sender, EventArgs e)

       {

           //test

           NorthwindDataContext db= new NorthwindDataContext();

// error

Error 1 The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\Documents and Settings\Administrator\My Documents\msdn\Ling\code\LINQ to SQL Part 5 (CSharp)\LINQ to SQL Part 5 (CSharp)\LinkPart5.Web\Default.aspx.cs 22 13 LinkPart5.Web

       }

   }

:== ??  help me

Thankyou

deap82 : On August 23, 2008 3:43 AM said:

uthai, you probably need to add a reference from the website project. In the solution explorer, right click the website project node, choose "Add reference..." and select the System.Data.Linq.

S.Pirashanth : On August 28, 2008 3:09 AM said:

Many thanks for the great videos

thegent38 : On September 19, 2008 2:58 AM said:

VB Please!!!!

wyckster : On September 20, 2008 11:47 PM said:

I don't get something...  I was trying to do the <%# Eval("Category.CategoryName")%> stuff in the ItemTemplate, but it wasn't working.  It showed "Databound" in the designer view ok, but in the browser, the field was empty.  

But then I went to The GridView arrow menu, under "Configure Data Source...", Next>, Advanced..., and I had to check "Enable the LinqDataSource to perform automatic updates".  Then the fields started showing up correctly.  Why is that?  

I can Eval other direct properties of the Product, like "CategoryID", but no foreign key lookups (i.e.: something of the form "Category.xxx" )

Why doesn't the automatic JOIN, through Category.Category name seem to work if I disable the LinqDataSource auto updates?

What's going on?

realfantasy : On October 12, 2008 3:12 AM said:

how to ADD NEW RECORDS as this wonderful video described select/edit/delete operations but not about ADDING NEW RECORD

kindly tell that way as well or some link ...

thanks

djibril_chimere_DIAW : On October 24, 2008 7:11 AM said:

Thanks !Jërëjëf!

siddJyoti : On November 04, 2008 6:30 AM said:

Just wish to say that it was simply great

Aminu : On November 17, 2008 8:56 AM said:

I have tried to add the Linq data C# class but i haven't been able to successfully accomplish that because there isn't a Linq data C# class just the normal C# class and i have tried those too but they dont give me the ability to add the data mapping file to the class. Please explain to me how i could accomplish this task. Thanks.

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Microsoft Communities