I have an AspTable with a small number of rows. I want to run a linq Where() on the collection to find one and remove it.
mytable.Rows is of type TableRowCollection
mytable.Rows.AsQueryable() says it returns a Linq.Queryable but intellisense on this does not give me my Linq operators.
...
I have a search form that allows users to search on several different fields in several different ways. Here is an example of my code.
var claims = from c in db.Claims select c;
switch (ddlSearchField.Text)
{
case "StartsWith":
claims = claims.Where(c => c.companyFileID.StartsWith(txtSearchBox.Text));
break;
ca...
Does LINQ to SQL support Oracle.ODP? If not, is a similar offering from Oracle available or in the works?
...
Here is my code:
var query = from row1 in table.AsEnumerable()
let time = row1.Field<DateTime>("time")
let uri = row1.Field<string>("cs-uri-stem")
let ip = row1.Field<string>("c-ip")
let questionid = row1.Field<int>("questionid")
...
I am getting the last 20 updated records in the database by using the following
var files = (from f in filesContext.Files
join ur in filesContext.aspnet_Roles on f.Authority equals ur.RoleId
join u in filesContext.aspnet_Users on f.Uploader equals u.UserId
orderb...
I want to insert into one table from the properties of multiple classes using Linq. Here are some representations of my objects( I am custom creating my Linq Objects with the attributes):
<Table(Name:="Certificates")> _
Public Class Certificate : Implements ICertificate, INotifyPropertyChanged
<Column(CanBeNull:=False, IsDbGenerated...
Hi All,
I am trying to get the DataView from a linq query expression which is querying a typed dataset. The result lands in a type of System.linq.IOrderedEnumerable. But i'm not able to convert this type to a Dataview although a few examples on the internet say that AsDataView function shoudl work but could you please throw some light o...
Hello All,
I am having a lot of fun with Linq2Sql. Expression Trees have been great, and just the standard Linq2Sql syntax has been a lot of fun.
I am now down to part of my application where I have to somehow store queries in a database, that are custom for different customers that use the same database and same tables (well, view, ...
Why did Andres Heilsberg designed LINQ syntax to be different than that of SQL (whereby made an overhead for the programmers to learn a whole new thing)?
Weren't it better if it used same syntax as of SQL?
...
What LINQ providers exist for Twitter and how do they compare? Are there any that let you query tweets, following, and followers in addition to publishing tweets? What about relational support? e.g.
from user in my-followers
where user.name.contains("drew")
and user.followers.count > 10
from tweet in user.tweets
where tweet.message.leng...
In Linq, extension methods like Where return an IEnumerable collection, but sorting methods like OrderBy return an IOrderedEnumerable collection.
So, if you have a query that ends with OrderBy (i.e. returns an IOrderedEnumerable), you can't later append a Where method - the compiler complains about the type being passed into Where.
var...
I am trying to build an ADO.NET Data Service with lots of entities and a few service operations. On one side I created a ASP.NET Web Application, in which an ADO.NET Entity Data Model and an ADO.NET Data Service are located. On the other side I created a second ASP.NET Web Application that has a Service Reference to the Data Service.
En...
Hi...I am fairly new to Code Contracts...and I ran into a problem.
I have in a method LINQ query that go something like this:
MyClass[] fields =
(from p in rType.GetProperties()
where p.CanRead
let fAttr = p.GetCustomAttributes(typeof(MyClassAttribute), true).SingleOrDefault() as MyClassAttribute
...
What is the Linq equivalent for row locking hints in SQL? For example:
select *
from MyTable with (updlock)
where MyField like 'A%'
Or is the whole question moot, because Linq caches all the objects anyway and it can't handle concurrent updates to an object already residing in memory?
...
Hello all,
Is there a online system which converts SQL - LINQ or can anyone else help convert the SQL - LINQ below?
SELECT MIN(startTime) As startTime, MAX(endTime) As endTime
FROM tblRA
LEFT JOIN tblA ON tblRA.asID = tblA.asID
WHERE 'xxxxxx' BETWEEN tblRA.startDate AND tblRA.endDate
AND tblA.availabilityDayOfWeek = 7
The main area I...
I need immediate help. I have to create a class in asp.net 3.5. This class will take a dataset as input and have method in it that will populate dropdown list. The dataset has 5 columns. Based on column name passed as parameter to this method, the dropdown list will be populated with data in that column. Please add linq query to thi...
Hi there!
Im using Linq...more specifically, PLINQO. anyway the following is an example of a query I have bound to a datagridview (winforms):
public static List<Task> GetUserTasks( Guid userID ) {
using (myDataContext ctx = new myDataContext()) {
try {
return ctx.Manager.Task.GetByUserID( userID ...
Hi Guys,
I have created small test web application which makes use of LINQ to SQL. I have ObjectDataSource and GridView. GridView's Datasource is ObjectDataSource. Now this ObjectDataSource uses one class(Method Name:GetAllTasks() as mentioned below) called MyTasks to populate all the task from Tasks table in SQL using Linq to SQL. It m...
Hello
Does anyone know what Join algorith does LINQ performs with its Join operator.
Is it NestedLoop, Merge, or HashSet? Is there any way to specify a different one, if supported?
Regards
Albert
...
In sql server, we can issue sql to get data like
select * from table where column like '%myword%'
select * from person where Soundex(LastName) = Soundex('Ann')
what's the linq query to match above sql?
...