Intersoft WebCombo Documentation
Walkthrough: Binding WebCombo to LinqDataSource
See Also Send comments on this topic.
Intersoft WebCombo > WebCombo Features Overview > Features Added in WebCombo 4 > LINQ to SQL Support > Walkthrough: Binding WebCombo to LinqDataSource

Glossary Item Box

This walkthrough will guide you to bind the WebCombo control to ISLinqDataSource.

During this walkthrough, you will learn how to do the following:

 Prerequisites

In order to complete this walkthrough, you will need the following:

  • Visual Studio 2008/2010 Application.
  • Microsoft.NET Framework 3.5.

 Step-By-Step Instructions

To create new web application and bind WebCombo to ISLinqDataSource

  1. Open Visual Studio toolbox. Drag WebCombo to your WebForm's designer surface.
  2. Drag LinqDataSource to the designer surface.
  3. Click Configure Datasource from the LinqDataSource smart tag.
  4. The LinqDataSource Wizard is pretty simple and straightforward. On the first screen, it should already select NorthwindDataContext by default, so simply click Next.
  5. On the second screen, since we want to select all customer properties, we don't need to configure anything else, simply click Finish. See below.



  6. Select WebCombo instance and open its smart tag. Choose LinqDataSource1 as the DataSourceID, set DataTextField to ContactName, and DataValueField to CustomerID. You can click on the dropdown to pick a field from the list. See below.


  7. You're all set. Save your WebForm, and run in browser.
  8. Try to type something into the textbox to search, or click on the dropdown arrow. The result should be similar to the following image.



    With LINQ to SQL (through LinqDataSource), WebCombo executes the query and returns it to the client in a fraction of second - no matter how large the datasource is.

See Also