views:

23

answers:

2

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?

+1  A: 

You can bind to an IListSource or an IEnumerable

Raj Kaimal
+1  A: 

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.

David Lively