Bind does not exist in the current context

written by Ryan Olshan on Saturday, March 04 2006

If you are using the new Bind() method, but are trying to pass it to a function or perform any other type of manipulation on it, you will get the following error as Bind() only allows for 1 way data binding:

Bind does not exist in the current context

Instead, you will need to use the following format:

Data Source (C#)
DataReader: ((System.Data.Common.DbDataRecord)Container.DataItem)[]
DataSet: ((System.Data.DataRowView)Container.DataItem)[]

Data Source (VB.NET)
DataReader / DataSet: Container.DataItem()

One other option is to use Eval().

Similar Posts

  1. What's wrong with Eval()?
  2. Nullable Types
  3. Generic Type Inference

Post a comment