user274364
user274364

Reputation: 1857

Different techniques to bind the Data Controls - ASP.net

Recently I was asked the following question at interview.

"What are the different way to bind a Data Control in ASP.Net".

I have answered

  1. Typed DataSet

  2. Collections

  3. Stored Procedure.

The interviewer expecting a lot more. Can anyone explain me the different way that we can bind the data controls?

Upvotes: 0

Views: 928

Answers (2)

3Dave
3Dave

Reputation: 29051

It's difficult to answer this question without knowing the context in which it was asked.

For instance, you can bind a datasource to a control in your markup or in the codebehind file.

You can refer to a control to bind explicitly, or use reflection to find it.

You can provide a datasource derived from a database call (for instance, from a stored proc, but that should really happen far, far away from the .aspx/.aspx.cs in your data access layer)

You can provide a collection of objects that are in no way tied to a database.

Blah. Blah. Blah.

It really depends on what sort of answer they're looking for. I've found that most technical interviewers are pretty open about their expectations - for instance, do they want to know what types of data sources can be used, where they can be assigned, or what? The question is vague.

Upvotes: 1

Raj Kaimal
Raj Kaimal

Reputation: 8304

You can bind to an IListSource or an IEnumerable

Upvotes: 1

Related Questions