0

As in the title I need to use stored proc to feed LinqDataSource to populate result in GridView. I got this concept to work in SqlDataSource but then I had Authentication issues (I'm running the app on tablets that can't provide Integrated Authentication that SQL Server requires - and I do not want to change SQL configuration). Linq works perfectly for me except when I try to use Calendar control to feed WHERE parameter. The stored proc worked much better and I could receive correct sets but now I have problems populating that to GridView.

Here is the code:

protected void myLinqDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
    DataContext myContext = new DataContext();
    e.Result = myContext.myTable(myCalendar.SelectedDate);
}

protected void myCalendar_SelectionChanged(object sender, EventArgs e)
{
    myLinqDataSource.DataBind();
    myGridView.DataBind();
}

In this configuration the pool times out. If I move binding to event handler, there would be nothing supplied to grid view. Maybe you know a better way to use stored procs with LinqDataSources?

outis nihil
  • 736
  • 6
  • 16
ArtK
  • 1,157
  • 5
  • 17
  • 31

1 Answers1

0

So since there was no answers here is one that I arrived at. LinqDataSource is great but pretty hard to configure declaratively. I used LDS dynamically to feed set into a List<>() and bound GridView to it. Worked perfectly!

ArtK
  • 1,157
  • 5
  • 17
  • 31