Comparing 2 Linq Applications - Unexpected Result

May 16, 2010

I drafted 2 ASP.NET applications using LINQ. One connects to MS SQL Server, another to some proprietary memory structure. Both applications work with tables of 3 int fields, having 500 000 records (the memory structure is identical to SQL Server table). The controls used are regular: GridView and ObjectDataSource.
In the applications I calculate the average time needed for each paging click processing.

LINQ + MS SQL application demands 0.1 sec per page change.
LINQ + Memory Structure demands 0.8 sec per page change.

This Is shocking result. Why the application handling data in memory works 8 times slower than the application using hard drive? Can anybody tell me why that happens?

View 2 Replies


Similar Messages:

Forms Data Controls :: Displaying Correct Result Inside DropDownList From LINQ Query Result

Jul 1, 2010

I have this ListView that has a Drop Down List.Everything works fine (I think/hope) except that the drop down list are not showing its result correctly.This is the code.

Front-End
[Code]....

The code behind consist of the page_load and the ItemDataBound
[Code]....

View 3 Replies

Linq To XML - Getting Correct Query Result, But It's Buried Deep In The Result Var?

Mar 1, 2011

I'm having a problem with my Linq to XML query. I'm getting the result data I want, but it's nested so deep that there must be a better way.Here is my XML:

[Code]....

I'm trying to get a list (simple string[]) of all Item IDs where Category Names contains "Other".Here is my Linq:

[Code]....

[Code]....

Here is a snapshot of my result from Visual Studio:The results I want are there ("item100", "item400", "item500"), but buried so deeply in the results var.

How can I get the query to return a simple

string[] = { "item100", "item400", "item500" }

View 4 Replies

ADO.NET :: How To Use Order By On The Result Of A LinQ To SQL Query

Dec 8, 2010

How can I use Order by on the result of a LinQ to SQL query ?

I have the following Situation:

Dim ret As New Object

ret = From status In tableStatus _
Select status.STATUS_ID, _
Text = Function_GetText(status.TEXT_ID)

Now I have to order this result on the field Text, has anyone an idea? (I can't use in my case Orde by Function_GetText(status.TEXT_ID))

View 3 Replies

ADO.NET :: How To Randomize A LINQ Query Result

Dec 5, 2010

How to randomize a LINQ query result?

Below takes 4 of the records but it won't randomize in every request. [:(]

Dim products = (From p In Northwind _
Order By Guid.NewGuid _
Select New With { _
.Name = p.Name, _
})
Return products.Take(4).ToList()

View 7 Replies

ADO.NET :: Get A Single Value Result From Linq Query

Aug 18, 2010

i want take a single value result from linq query

if i have :[Code]....

the variable result does not return nothing, only tostring() and similar how can i get a single result from linq query and use it in my ID variable?

View 1 Replies

VS 2010 - How To Pass The Result Of The Linq To Textbox

Sep 27, 2010

How can I pass the result of the linq to a textbox?

Code:
string search = txtSearchPO.Text;
IPSBLL.TransactionInfo dbInfo = new IPSBLL.TransactionInfo();
var q = from info in dbInfo.GetTransactionInfo()
where info.PONumber == search
select info;
txtPONumber.Text = q;

I need to access the column data something like this:


Code:

DataTable.Rows[index].columnName
How can I do that in LINQ?

View 7 Replies

C# - How To Populate Dropdown With A Database Result In Mvc Linq EF

Mar 16, 2011

Here is my Controller:

public class MatchManagerController : Controller
{
//
// GET: /MatchManager/
public ActionResult Index()
{
return View();
}
public ActionResult CreateMatch()
{
return View();
}
}

Here is my View:

@model MatchGaming.Models.MatchModel
@{
ViewBag.Title = "CreateMatch";
}
CreateMatch
@using (Html.BeginForm()) {
@Html.ValidationSummary(true).....

I want my MatchTypeId to be a drop down that populates from my table MatchTypes.

View 1 Replies

ADO.NET :: Assign Linq Query Result To GridView?

Dec 9, 2010

New to Linq and Var type have a method where linq query is executed, want to return the result and assign it to GridView. but method don't take the return type as var.

So was wondering how do i return this query result?

Should i assign this result to DataTable first and make the method return type as DataTable?

Here is the code, This is what i want to do but not sure what is the right way

[Code]....

View 6 Replies

C# - A Linq Question With IEnumerable<DataRow> Result

Dec 21, 2010

How can i convert following sql guery to LINQ in C# ? I dont need all columns from both tables and the result set should be IEnumerable<DataRow>

select c.level,cl.name,c.quantity
from dbo.vw_categories c
left join dbo.vw_categoriesLocalization cl on c.level = cl.level and cl.language = 'en'
where c.level like '000%' and c.level <> '000';

View 2 Replies

What Is The Underlying Type Of The Result From A Linq To Entities Query

Jan 20, 2011

for example,

var result = from category in myEntities.Categories
where category.UserId == userId
orderby category.CategoryName
select category;

What is the type of "result"? I casted it to an IQueryable variable and it worked except it did not have some of the methods normally available, e.g. Count(). In my program I have to cast it to some explicit types and then use the Count() method.

View 3 Replies

ADO.NET :: How To Add Hard Coded Values To LINQ Query Result

Aug 31, 2010

I am running a LINQ query which populates a list used by a DropDownList, I need to insert an "Unassigned" value to the list. The function below queries the values correctly from the db but does not insert the "Unaasinged" value to the list.

[Code]....

View 2 Replies

DataSource Controls :: Dynamic Sql Result Set Into Linq To Sql Designer?

Apr 13, 2010

I have one sproc with Dynamic Temp Table. Sproc returns dynamic temp table rows and when I drag and drop the sporc on to Linq to Sql Designer I am not getting Return Type as "(Auto-generated Type).

how can I get Return Type as Auto-generated Type.

View 1 Replies

MVC :: How To Pass Linq To Entities Query Result To View

Apr 1, 2010

i have a new question: i read all the tutorials that i found but i cannot understand how to pass a result of a linq to entities result to the view so that i can display the results. My query is actually in the controller function ot the view, i would now loop the results and display them in the page. How?

View 23 Replies

Get Data From Two Tables With Linq And Return Result Into View

Mar 5, 2011

I have two tables: Projects and ProjectsData and I want to execute query with join and get the result in the View. In the Controller I have this code:

ViewBag.projectsData = (from pd in db.ProjectsData
join p in db.Projects on pd.ProjectId equals p.ID
where pd.UserName == this.HttpContext.User.Identity.Name
orderby p.Name, p.ProjectNo
select new { ProjectData = pd, Project = p });

What I should use in the View to extract this data. I tried that:

@foreach (var item in ViewBag.projectsData)
{
@item.pd.UserName
}

but it doesn't work.

View 1 Replies

C# - Bind A Grid To An Anonymous LINQ Result, Then Commit Changes To DB?

Mar 4, 2011

I've been looking into how best to do this and wisdom would be appreciated. For read only purposes, I've been happily using LINQ and binding it to a grid. For editing purposes, I've used the LinqDataSource control, enabled the Edit/Delete operations in the process, and I have a nice editable grid bound to some or all of the table's fields.Now I have a situation where I want to edit a few fields in table A, but there are various values in linked table B that I want to display in that grid too (no editing of those). So my query looks like the below. The fields in tblDupes (cleared, notes) are what I want to edit, but I'd like to display those tblVoucher ones.

var theDupes = from d in db.tblDupes
where d.dupeGroup == Ref
select new

[code]...

A similar but different question LINQDataSource - Query Multiple Tables? sent me looking at scott Guthrie's blog entry http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx, where he handles various events to have a LinqDataSource with a custom query across tables. This still seems aimed at explicitly designed classes though, even if the class has only a subset of the fields.

So my question is: is there an easy way to allow committing of the changes made to the anonymous collection (a changes.Submit type action), or just an easy way to 'display' fields from another table while not involving them in the updating?EDIT: Thinking more, it doesn't have to be anonymous really. I'd be happy to define a class to contain the elements in that query, since it won't change often. But, those elements would be across two tables, even though only one needs updating. Not sure if that suggests entity framework would be more suitable - I get the feeling it wouldn't - I don't want the whole 'model' always grouping the fields in this way.

View 1 Replies

ADO.NET :: Setup Query Result Shaping For LinQ To SQL Instead Of Entity Framework?

Sep 9, 2010

I am new to this, and I am trying to implement a linq query similar to db.Genres.Include("Albums") command from

mvc music store using my current DB setup. I realize that the tutorial mentions Checlking the "Include foreign key columns in the method" when creating the tables in ADO.NET, but if I am using LINQ to SQL classes, then how can I obtain the same effect. And how do I use
db.Genres.Include("Albums") to simplify my life?

View 2 Replies

Get Data From Two Tables (join) With Linq And Return Result Into View?

Mar 4, 2011

I want to get data from Projects(which have CourseId) and related CourseName from Courses table.

I have written following code:

var projects = from n in db.Projects
join c in db.Courses on n.CourseId equals c.ID
orderby n.Name
select new { Project = n, Course = c };
return View(projects.ToList());

and I get error:

The model item passed into the dictionary is of type 'System.Collections.Generic.List1[<>f__AnonymousType22[ProjectManager.Models.Project,ProjectManager.Models.Course]]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[ProjectManager.Models.Project]'.

What I need to do in Controller and in View to display this data?

View 2 Replies

DataSource Controls :: How To Pass A Result Set From A Linq.dataquery To Another Sub Or Function

Feb 1, 2010

I'm trying to populate a treeview control using linq.

I use the following code

[Code]....

how can I declare c in fillChildren

View 2 Replies

ADO.NET :: Check Result/success Of Linq Insert/update Query?

Jan 3, 2011

How do i check if linq insert/update query was successfull or how many rows were added/updated?

View 1 Replies

DataSource Controls :: Outer Join In LINQ Getting My Desired Result?

Jun 26, 2010

I'm trying to achieve an outer join in LINQ but I'm not getting my desired result.There are two relational tables between Fruit_Name and Fruit_Ripe.The Fruit_Ripe table has a boolean field (IsRipe) that I use in my condition.The condition let me show all fruits that is not yet rippen (false) or fruits that isn't inputted yet in Fruit_Ripe table.

Dim fruit_salad = From myFruit In _DataContext.Fruit_Name
Group Join myRipeFruit In _DataContext.Fruit_Ripe On myFruit.fId Equals myRipeFruit.fId Into Group
From fruitty In Group.Where(Function(d) Not d.isRipe =

[code]...

View 6 Replies

DataSource Controls :: Using LINQ To Pull Out A Single Value From A Single Result Row Of A Join Query?

May 25, 2010

For context: First of all, I am new to LINQ, as I have been using SubSonic for quite some time now.

I have two tables, Users, and Affiliates. They both have a very typical schema. The FK that joins them is the UserId field, which is in the Affiliates table. I want to create a LINQ query that pulls the Username from the Users table using the AffiliateId value. The AffiliateId is a primary key of the Affiliates table.

I have tried to accomplish this using many variations of the following code:

[Code]....

In the above query, I expect to get a single row result set. However, I instead receive the entire table of results.

How can I make this work? I have yet to see an example or article out there to do what I am trying to do.

View 9 Replies

Forms Data Controls :: Showing Linq Result Values Inside Dropdownlist Inside Listview

Jun 22, 2010

I have a listview that is showing its result by using a linq query. The linq query goes like this.

[Code]....

* db.Varer: Varer is a table that contains basic product information like proudct name, product nr. etc. ** a.fk_kategori_id == CatParamId : I'm just saying limit the result according to the Category ID (a.fk_kategori_id). The category id is coming from a dropdownlist (CatParamID) *** Join: Besides the Varer (Product) table I also have another table, Sizes. This Sizes table contains 6 columns (ID_Sizes (int) primary key and the columns: OneSize, S, M, L, XL, XXL all are bit (true or false)). There is a relationship between Varer table and Sizes table. It says that I can only insert a value into the "fk_sizes_id - column" of varer table if that value already exists as primary key within the Sizes table. **** I'm starting by picking basic product values like productId, ProductName etc from the Varer (a) table ***** Then I'm picking the corresponding Sizes values (onesize, s, m, ...) from the Sizes table. Now within my ListView I'm showing the above result by using Eval, like this.

[Code]....

And this works perfectly, but now comes the thing that is causing me trouble. I have the below drop down list (still within the ListView ItemTemplate):

[Code]....

I want this drop down list to be populated with only those of the "linq query's Sizes table result" that are true. By "Sizes table result" I mean these

[Code]....

View 14 Replies

WCF / ASMX :: Building Services To Work With Web Applications And Console Applications?

Jun 7, 2010

I've been worked with web services so far, and I'm interested in expanding my services to console applications as well so I started digging up with WCF but I'm conserned that I won't be able to use the HttpContext collection that I've been used to do with web services one important thing which is to generate a random value from HttpContext.Current.Request.ServerVariables["ALL_HTTP"] that I need to reckon if it's the same or at least near what machine that is calling my service. How can I overcome this problem?

I need to know what machine is calling to count the number of attempts to login into my system for example. So must do it inside of the svc code otherwise if I let the client inform what ip address or what computer he is using, anyone could forge this argument and surpass by another machine. May be I'm approaching this matter wrongly. And I should count the number of attempts per state session, but how is it done?

View 1 Replies

Configuration :: Deploying Web Applications With Sub Web Applications?

Apr 22, 2010

Our corporate intranet is designed so that each web application is a child application in the primary application.. Everything has worked fine with Visual Studio 2008 and even in 2010 running the website locally works great, the output directory for the child apps is ..in and the ProjectName.dll copies to that directory.. When I do a publish however it does not and I have to manually copy the dll from the bin folder in the project folder to the parent bin folder, this isn't hard of course but more of a pain in the butt each time I need to publish something. I made sure the output directory is correct for both debug and release yet on publish is just copies it to the child bin and not the parent bin as needed.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved