Questions tagged [linqdatasource]

LinqDataSource is a Web Control which enables the use of Language-Integrated Query (LINQ) in an ASP.NET Web page through markup text to retrieve and modify data from a data object.

LinqDataSource is a Web Control which enables the use of Language-Integrated Query (LINQ) in an ASP.NET Web page through markup text to retrieve and modify data from a data object.

141 questions
2
votes
1 answer

LINQ: How to refresh a GridView bound to LinqDataSource?

I retrieve keywords from a textbox and want to refresh a GridView that is bound to a LinqDataSource. I assume I can do this in the OnTextChanged function as follows protected void OnTextChanged(object sender, EventArgs e) { // do LINQ…
user776676
  • 4,265
  • 13
  • 58
  • 77
2
votes
1 answer

Should I trust LinqDataSource to clean up properly?

Taking my first stab as using the OnSelecting method of LinqDataSource so that I can specify a more complex query, I wrote this: protected void CategoriesDataSource_OnSelecting(object sender, LinqDataSourceSelectEventArgs e) { using…
Dave
  • 1,521
  • 17
  • 31
2
votes
2 answers

Prevent LinqDataSource selecting on every post-back

There are a GridView and a LinqDataSource in a page and few buttons which their actions are not related to the GridView and its LinqDataSource. Why on each post-back of those buttons the Selecting method of the LinqDataSource will call? Is this…
Babak
  • 3,716
  • 6
  • 39
  • 56
2
votes
2 answers

Dropdown List using LinqDataSource Formatting Issue

I have a dropdownlist which is bound to one of the LDS. Here is the code for that: And the code for LinqDataSource3 is:
RG-3
  • 6,088
  • 19
  • 69
  • 125
2
votes
1 answer

LinqDataSource throws a ChangeConflictException for an unknown reason

I'm currently facing an odd problem with an old project. The project uses a FormView to edit data. The FormView is bound to a LinqDataSource. Upon updating the edited object, I do receive a System.Data.Linq.ChangeConflictException - Row not found…
citronas
  • 19,035
  • 27
  • 96
  • 164
2
votes
2 answers

How to modify Bind("MyValue") in asp.net

I'm having headache with Time values and multiple time zones. I'm storing new DateTime values in UTC time, but I face problem when I try to modify them using LinqDataSource and GridView. I can easily show correct time in
Milan
  • 969
  • 2
  • 16
  • 34
2
votes
1 answer

How to lock a SQL record with LinqToSql?

I'm using a LinqToSql DataContext and I want to lock a record for being opened in write mode. Meaning while one user in Hong Kong has a record open in write mode, another user in France can't open that record in write mode. How?
Will Du
  • 140
  • 2
  • 13
2
votes
1 answer

Retrieve data from LinqDataSource before Skip and Take happen?

I have a GridView that uses LinqDataSource. The GridView has default paging enable. I would like to retrieve the data from LinqDataSource before the paging takes place so that I could calculate the Sum of one single column of the whole database…
Sơn Trần-Nguyễn
  • 2,188
  • 1
  • 26
  • 30
2
votes
3 answers

How to query with unknown number of where parameters in ASP.NET and C# with Linq2SQL?

I have a GridView using LinqDataSource to populate data from table Tickets. The LinqDataSource has AutoGenerateWhereClause="True" so that the where clause can be constructed dynamically like this:
Sơn Trần-Nguyễn
  • 2,188
  • 1
  • 26
  • 30
2
votes
1 answer

On ASP.NET ListView with LinqDataSource, display the data when the search button clicked

I have a ListView setup with LinqDataSource and a button that triggers search function. To avoid display data on page_load, I set ListView's DataSourceID in the Click event of the search button, bind it and set result data in LinqDataSource's…
2
votes
1 answer

ASP.NET GridView Sort?

I'm performing a query with a sort in the Selecting event of the LinqDataSource. I'm then casting my query to a list and assigning it to the result. I'm using this data source in an ASP.NET gridview. I can see the list is sorted but when the…
Curtis White
  • 6,213
  • 12
  • 59
  • 83
2
votes
1 answer

LinkDataSource can't load DataContext

I am trying to populate a dropdown list control on an web page using VS 2008 and keep getting an error that it can't load the DataContext. My backend is a SQLx server 2005 DB. I create a Link To SQL data context and have 1 table in it. My…
MikeD
  • 741
  • 5
  • 20
  • 38
2
votes
2 answers

No parameterless constructer defined for this object when putting EnabledDelete=true on LinqDataSource

If I have a LinqDataSource without EnabledDelete, EnabledUpdate, EnabledInsert, it works fine, but as soon as I add those properties to the data source, I get the error: No parameterless constructor defined for this object.
Xaisoft
  • 45,655
  • 87
  • 279
  • 432
2
votes
1 answer

Character constant must contain exactly one character

When you get this error "Character constant must contain exactly one character" I had this code but it constant gave me the above error in my LinqDataSource:
JanBorup
  • 5,337
  • 1
  • 29
  • 17
2
votes
1 answer

ASP.NET LinqDataSource WHERE clause

I need to make a WHERE clause for my LinqDataSource which depends on the currently logged in user. Of course, I have access to the currently logged in user in the code-behind and I specifically need the user ID to fetch only data belonging to…
Deniz Dogan
  • 25,711
  • 35
  • 110
  • 162
1
2
3
9 10