Tagged Questions
1
vote
2answers
432 views
linq to sql “All” operator type query
String[] codes = new[] {"C1", "C2" }
Below is the schema for SomeEntity
fkey code
--------------
f1 C1
f1 C2
f2 C2
f2 C3
f2 C4
f3 C5
I have to write queries that can get all ...
0
votes
2answers
390 views
Report showing raw data instead of data from linq query?
My report keeps showing what I believe is raw data in the report for the name from the employees field. The sql tables have the correct data but the report never has the correct name. It always shows ...
0
votes
2answers
165 views
Get categories and list of items in this categories
I trying to get list of categories and their items in the same query in Linq.
something like list of category item and List of related products.
for example list of items like:
Class MyClass {
...
0
votes
2answers
265 views
Table association is lost during DBML designer.cs Update
I am working on a .Net 4 project. Recently a column was added to a table say A and after that all of the associations of other tables with table A are lost (any table that had a foreign key from table ...
0
votes
2answers
98 views
Select only Saturdays data from date range
I need to be able to display data for all date range and for the same date range but only for Saturdays.
Data stored in sql server.
Table:
DateTime Vlaue
Is it possible to create linq to sql ...
0
votes
2answers
104 views
Adding a non-SQL where clause to LINQ-2-SQL
I have a Linq-2-SQL that updates the IEnumerable<Locum> LeftOverLocums before the inner foreach loop. I need to add one more boolean clause to the Where portion but it has nothing to do with SQL ...
3
votes
1answer
253 views
Used 'new' operator in LINQ to SQL query, but same instance is referenced in every result
Can anyone explain the behavior I am seeing in the minimal code example below? It seems that for a given field or property, the same two instances of the Entry class are being reused in each ...
3
votes
1answer
504 views
Linq to SQL : Left joining a grouped set makes a Cross Apply/Outer Apply
Basically I'm making a report type query where I am aggregating data from multiple tables and left joining it to a single table.
it looks a bit like this:
var docs = from x in DB.Docs
...
1
vote
1answer
116 views
Is it worth putting a business logic layer on top of Linq to SQL?
I feel like I may be doing something dumb.
I've had a Linq to SQL library running for years, and used it in several applications that use the same database. There are a bunch of things I'm not ...
1
vote
1answer
394 views
Querying multiple tables with a where clause in LINQ to SQL
Forgive my ignorance with Linq to SQL but...
How do you query mulitple tables in one fell swoop?
Example:
I want to query, say 4 tables for a title that includes the following word "penguin". ...
1
vote
1answer
137 views
using Min and Max funtion in this LINQ query with joins ? please guide
I am making a LINQ query which is join of multiple tables. In result set I want to ad a column which shows Min and Max date combinely [e.g.(20/3/2012 - 25/4/2012)] from table.
The structure of table ...
1
vote
1answer
131 views
Linq query need correct sum
I am using .NET 4 Data Visualization Charts and am using a Linq query to get the data for the chart. I am new to Linq so not sure on how to word this query. Here is what it does, I have the follwoing ...
0
votes
1answer
65 views
Linq to SQl with multiple Joins
I am trying to write a linq to SQL lambda query which is equivalent to the below SQL query.
Select t.Task_Id
FROM taskSet ts
JOIN taskSet tsg ON tsGroup.SetId = ts.SetId
JOIN tasks t ON t.task_id = ...
0
votes
1answer
75 views
How to apply group By on multiple table in linq
I have query in linq like this
var result = from item1 in context.ServicePriceInsertData
join item2 in context.GroupMasterInsert
...
0
votes
1answer
38 views
EditItemTemplate
I am trying to get text from textBox in editItemTemplate and nothing seems to work. I have tried to use FindControl in my RowUpdating and still no luck. I am working in c#. Any good walk thoughs on ...
0
votes
1answer
79 views
How to use let with this LINQ query?
Here is my LINQ query with multiple joins:
it is working good but I need to do an enhancement in its working.
var selectedResults=
from InvoiceSet in Invoices
join BookedAreaSet in ...
0
votes
1answer
112 views
Multiple LEFT OUT JOINs in Linq to Sql
I have the following structure of tables:
Items
- ItemId
- ItemTypeId
ItemTypes
- ItemTypeId
ItemTypes_Locale
- ItemTypeId
- Id
...
0
votes
1answer
204 views
MVC3 ViewModel with multiple LINQ queries, is it making multiple DB calls?
If I am creating a viewmodel to pass to a view and my viewmodel is comprised of several
properties from the same object, how should I create the LINQ query? At the moment I'm doing it like this:
...
0
votes
1answer
53 views
Using LiveLinq's .AsLive() with Linq-2-SQL and a pre-existing DBML
I’d like to know how to use LiveLinq with Linq-2-SQL and a pre-existing DBML (in a separate DLL). I already have a System.Data.Linq.DataContext
Can LiveLinq work here. I’m currently interested in ...
0
votes
1answer
307 views
linq to sql (VS 2010) - insert doesn't work
I have a class containing my data context:
private static drDataContext db = new drDataContext();
I also have the method:
public static void InsertSelfRatings(List<DeveloperSelfRating> ...
0
votes
1answer
588 views
Help with linq to sql compiled query
I am trying to use compiled query for one of my linq to sql queries. This query contains 5 to 6 joins. I was able to create the compiled query but the issue I am facing is my query needs to check if ...
2
votes
0answers
301 views
Convert Byte array to pdf with c# code
I have a table with much more binary type column. I have to convert these byte array to pdf. I write this with c# codes as follows:
this.Cursor = Cursors.WaitCursor;
using (CMEntities ...
2
votes
0answers
178 views
Cannot Perform Linq-To-Sql Stored Procedures with MVC-Mini-Profiler
I am using the MVC-Mini-Profiler in my ASP.net 4.0 C# environment along with MSSQL and Linq-to-SQL. I am having an issue with using L2S with the profiler. Whenever I return new ...
1
vote
0answers
177 views
Pass table name a parameter to the Data Context method using LINQ to SQL in C#
I have created a method which delete data from the database by joining a db column with a csv file, I have a list of tables in a Data Context which I need to iterate, i means that I need to change the ...
1
vote
0answers
200 views
DataGridView not showing updated sql columns
My datagridview is not pulling in two new fields I added to the table in sql. I re-added the linq2sql object in visual studio with the updated table entries but I am still not able to see the two new ...
0
votes
0answers
7 views
reuse datacontext after exception
When I want to delete some thing from relational database, some times it gives me SQL exception!
I can not reuse my datacontext because the old thrown exception repeats in all over my project !
How ...
0
votes
0answers
141 views
Linq to SQL / SQlite DB: Split column to multiple rows
Environment: Winforms, VS 2010, SQlite DB
I am using Linq to SQL to query the SQlite DB.
Here's the query
var result = (
from f in Table1
join comp in Table2 on f.ID equals comp.fID
...
0
votes
0answers
144 views
Access Linq to SQL dataContext tables and their Property through variables
I have a table say ProjectMaster having columns
- Id
- ProjectName
another table ThreatMaster having columns
-Id
-ThreatName
-ProjectId
-ThreatDescription
ProjectId is a foreign ...
0
votes
0answers
89 views
How to update a database column with a calculation in Linq to SQL
I have the following POCO class:
public class Reservation
{
private int? _reservationID;
[Column(Name = "ReservationID", CanBeNull = false, AutoSync = AutoSync.Default, IsPrimaryKey = true, ...
0
votes
0answers
122 views
Cannot get Dynamic Linq to work
I am doing the Jquery.JqGrid example and everyhting works fine, however I cannot get the paging to work. The example uses Dynamic LINQ and I have added the DLL from NuGet, and also added Dyanmic.css ...
0
votes
0answers
71 views
strange results with Linq-to-sql
I have a C# Solution (VS 2010) consists of multiple projects, one of the projects called DB_Server, contains a mdf Database with Linq-to-sql classes , inside this projects too there is a class called ...