Questions tagged [loadoptions]

12 questions
6
votes
4 answers

Compiled LINQ query & DataLoadOptions... with a twist!

I know about the method discussed here: Solving common problems with Compiled Queries in Linq to Sql for high demand ASP.NET websites ... but this doesn't work for my situation as i get a : "Setting load options is not allowed after results have…
krisg
  • 796
  • 1
  • 9
  • 24
3
votes
0 answers

loadOptions is not called when AsyncSelect is wrapped by another component

I have a component that wraps a react-select AsyncSelect component: The wrapper component's render() function looks like this: render() { return (
omer
  • 1,242
  • 4
  • 18
  • 45
2
votes
0 answers

Random DataReader errors and thread-specific DataContext allowing for changing DataLoadOptions

My .NET MVC project has reached the stage of testing with multiple users and I am getting seemingly random errors (from any screen in the site) relating to Linq2Sql DataReader issues, such as: 'Invalid attempt to call FieldCount when reader is…
1
vote
3 answers

How to tell if LinqToSql DataContext has previously returned results

When setting the LoadOptions property on a LinqToSql DataContext, if the context has already returned results from another query, the exception "Setting load options is not allowed after results have been returned from a query" is thrown. What I…
Simon
  • 1,499
  • 3
  • 17
  • 23
1
vote
1 answer

Is there any way to speed up datatable.LoadDataRow()?

I am refreshing a data table by calling DataTable.LoadDatatRow as follows: public void FillTable(DataTable myTable, IEnumerable readings) { var index=0; foreach(var reading in readings) { LoadRow(myTable, reading,…
MLavine
  • 195
  • 1
  • 5
  • 13
0
votes
1 answer

WordJS API adding a hyperlink to a tablecell causes general exception

I am writing a Microsoft Word Add-in using the Word javascript API. I am trying to create a new table and insert it into the document and then trying to add a hyperlink to one of the cells. This causes a GeneralException on the subsequent…
Bill King
  • 72
  • 9
0
votes
1 answer

loadOptions getting called for same string which was searched earlier and cacheOptions is enabled

I am trying to use AsyncSelect from react-select library. I have enabled cacheOptions option. Using below mentioned steps I am seeing an issue with loadOptions Search for a string test List of options gets displayed Clear the input field Enter same…
Pratik
  • 1,531
  • 3
  • 25
  • 57
0
votes
1 answer

react-select async callback is not called

I'm using react-select's AsyncSelect component, and try to resolve it from a callback with the following code: loadOptions(inputValue, callback) { this.props.asyncFunctionWithCallback(resp => { callback(resp); …
omer
  • 1,242
  • 4
  • 18
  • 45
0
votes
1 answer

Rewrite a LinqToSql query to return same instances without LoadWith

I'm investigating CompiledQuery performance, but CompiledQuery is allergic to LoadWith. using (CustomDataContext myDC = new CustomDataContext()) { DataLoadOptions options = new DataLoadOptions(); options.LoadWith(c => c.Orders) …
Amy B
  • 108,202
  • 21
  • 135
  • 185
0
votes
2 answers

When are records from related tables loaded with LINQ2SQL

Let's say I have two tables: Report Comment And assuming I have a database context: var reports = db.Reports(); How can I make sure all Comments for each report are loaded as well? At this point I want to disconnect from the database but…
TimothyP
  • 21,178
  • 26
  • 94
  • 142
0
votes
1 answer

LINQ: Can I load more than one generation of descendants with DataLoadOptions?

I'm using the following DataLoadOptions: DataLoadOptions options = new DataLoadOptions(); options.LoadWith(f => f.FamilyLanguages); options.LoadWith(fl => fl.Language); The Family object comes back with a list of…
Mike Pateras
  • 14,715
  • 30
  • 97
  • 137
-2
votes
1 answer

Function that returns a promise, which is the set of options to be used once the promise resolves

In my code loadOptions gives me the following error message " Function that returns a promise, which is the set of options to be used once the promise resolves." but I've already made some attempts in the code but without success. Can anyone help me…