linqdatasource

LinqDataSource dynamic parameters - forcing an OR with WhereParameters

In my "selecting" statement I need to add two dynamic parameters when using the LinqDataSource's WhereParameters collection: e.WhereParameters.Add(param, True) However, the system adds these parameters as AND, but I want to perform an OR where either parameter 1 OR parameter 2 is true. How can this be done? ...

Getting Xml Columns from LinqDataSource to appear in a GridView

I have a LinqDataSource and a GridView displaying a table. Columns of type xml don't show up. I'd like them to show up something like they do in Sql Server query outputs, with a link to display the clickable xml, though there may be another approach i'm not considering (maybe a styled display of the xml data, etc.). Two things i'd like t...

LinqDataSource: Filtering and binding to gridview

the problem is not solved the way i wanted but i go ahead give the credit to : ŁukaszW.pl for his time and effort. i am using gridview control and a linqdatasource and its all working fine and i have added the functionlity of searchingBySubject and i added WhereParameters and than binding my gridview (see the code below) but somehow its...

how to refresh the gridview after it filters (Dynamic) using LinqDataSource ?

AllowSorting="True" AutoGenerateColumns="False" DataSourceID="LinqDataSource1"> SortExpression="UserName" /> SortExpression="FullName" /> SortExpression="Email" /> SortExpression="LastLoginDate" DataFo...

LinqDataSource - filtering for null values

I am writing an ASP.Net web application. I have listview, it's datasource is a LinqDataSource. In my database, I have a staff table and I am trying filter for records by their team using a dropdownlist. This works fine, until I select "All" in the dropdownlist. It returns all staff except for the ones where the teamID is null. How c...

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

Hi, 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: <asp:LinqDataSource ID="dsGridView" runat="server" AutoGenerateWhereClause="True" ontextTypeName="TicketsDataContext" TableName="Ticket...

Retrieve data from LinqDataSource before Skip and Take happen?

Hello, 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 using Linq2SQL. Right now, I'm using LinqDataSource_Selected event with LinqDataSourc...

Displaying a gridview's footer with an empty (linqdatasource) datasource

The datasource of the datagrid is a LINQDataSource which relies on the value of a dropdownlist. In addition, I want to use the footer to insert new records - so I'd prefer not to use the empty dataset template. I am trying to find a way to always display the footer regardless if the datasource is empty or not. EDIT: Is there a way to ...

Binding LinqDataSource from code-behind to Gridview

i have a grdidview control on the .aspx page and i am trying to connect dynamically from code behind and bind the gridview but somehow it throwing me an error... what is wrong with this code? any help? LinqDataSource LDS_POReport = new LinqDataSource(); LDS_POReport.ContextTypeName = "DataContextDataContext"; L...

Why is FormView calling LinqDataSource.Select?

I have a FormView and a LinqDataSource connected to a single table. When entering Insert mode, the FormView calls LinqDataSource.Select method generating an inefficent "SELECT * FROM mytable" query that returns all rows. Is this the expected behavior? Thanks! ...

LinqDataSource "OnSelecting" event not firing on Post-backs

I have a web page with two dropdownlist controls, each bound to separate LinqDataSource objects. One displays a list of Categories and the other displays a list of Articles. The Category choice drives Article list (at least, that's my intended behaviour). The Article list is also filtered based on the users language preference, stored in...

Properties without UpdateCheck="Always" have no value when accessed through LinqDataSource event handler

I have a practise of setting UpdateCheck="Never" for most table properties in the DBML file. This is because I don't want the extra overhead from concurrency checking (see Turn Optimistic Concurrency Off Unless You Need It) However, I have noticed a strange side effect of doing this. Can anyone explain this? If I am updating a particul...

LinqDataSource - is default insert parameter with dbnull value possible?

I need to do some simple (or so it seems) databinding and CRUD type operations on an ASP.Net page. I'm using a LinqDataSource connected with a FormView. The table that i'm trying to insert into has default contraints for these fields: [Created] [datetime] NOT NULL [CreatedBy] [nvarchar](50) NOT NULL [Modified] [datetime] NOT NULL [Modif...

LinqDataSource DataContext Object Not Showing In Configure Data Source

Hi, I added a LinqToSQL Class to my project and put it in my App_code folder. I then added a LinqDataSource to a new web page and tried to configure it to use this class, but it does not show up as an option in the DataContext drop down. I moved the class to the root directory of my project and it is now available in the DataContex...