I'm updating a LINQ object prior to SubmitChanges. The values of the object's properties are being taken from a series of TextBoxes.
When I read in one specific TextBox, another TextBox changes its value with no apparent cause.
//...
loc.Lattitude = txtLocLat.Text; // txtLocLong.Text changes to previous value
loc.Longitude = txtLocL...
I have a stored procedure that is called to validate a user during login.
If success it returns the user entity, and that works good! My question is if it doesn't work, I'll raise an error in the SP, How do I catch this error and use it in the best way? Right now I'm getting nullrefference, this is the code:
Store procedure:
ALTER PRO...
I am looking all over for this dll but can't find it anywhere? anyone know where to get it and can help me?
Thanks!
...
i want to create a generic class that would accept T.
T is an object coming from Entity Framework representing a Table, or a View of that table.
properties on both would be the same.
I would like to create a generic class, that will accept the table or view, and construct a linq query based on the properties.
so i would need to d...
I have two tables:
Orders
OrderProducts - An order can have 1 to many orderProducts records associated with it.
What I am trying to do (unsuccessfully) is to implement a GridView search using a LinqDataSource wherein the search returns Order results where any of the OrderProduct.Manufacturer columns contain a search query.
I was ho...
I'd like to say
int x = magic(), y = moremagic();
return i => i + (x/y);
and have the x be captured as a constant instead of a variable reference. The idea is that x will never change and so when the expression is later compiled, the compiler to can do constant folding and produce more efficient code -- i.e. calculating x/y once inst...
I have a data object
Data = class
public
s: string;
i: Integer;
end;
with many of them in a list (or some collection):
var ol : List<Data> := new List<Data>;
ol.Add(new Data(s := 'One', i := 1));
ol.Add(new Data(s := 'Two', i := 2));
ol.Add(new Data(s := 'Three', i := 3));
ol.Add(new Data(s := 'Four', i := 4))...
Hi,
I have a basic view that returns the same columns as a table (give or take 1 field)
in my DAL code, i am returning a list of MyTableObject, however in some cases, i will call the view to return the same data, but from different sources.
List<MyTableObject> tableObjects = new List<MyTableObject>();
if (case1)
tableObjects = ent...
I'm new to linq, now I need to do flexible sorting with sort parameter specified.
but
var query =
from accessdoc in dt1.AsEnumerable()
join content in dt2.AsEnumerable()
on accessdoc.Field<string>("name") equals content.Field<string>("FileName")
into docs
orderby accessdoc.Field<DateTime>("CreateDate") descending ...
Hi
I have one asp.net application , in which i am using linq for data manipulation. But while running, i got one exception like "Sequence contains no matching element
" . My code is shown below..
if (_lstAcl.Documents.Count > 0)
{
for (i = 0; i <= _lstAcl.Documents.Count - 1; i++)
{
string id = _lstAcl.Documents[i].ID....
I have Product table and Officer table as follow:
Product
ProductID | ProductName | Officer1ID | Officer2ID | Officer3ID
--------- | ----------- | ---------- | ---------- | ----------
12 | Mouse | 123 | 124 | 125
13 | Keyboard | 234 | 235 | 0
Officer
OfficerID | OfficerName
-------...
Hi all!
Is there any way to insert part of the code between { } dynamically?
LINQ QUERY:
var csvdata = from csvline in csvlines
let column = csvline.Split(';')
select new {
produkt = column[0],
cislo = column[1],
part = column[2],
...
When working with stored procedures in linq, I can go to my SP and select what type of entity it should be returning. This works fine in most cases, except the time's I'm not sure of what will be returned. If I don't select what type of entity to return i get the standard
return ISingleResult<SP-Name>
I thought I would be able to wor...
hi there
I have a grid bound to a linqed SP thus:
Session["results"] = db.spGetCaseByNumberOrSurname(txtCaseNum.Text.Trim(), null).ToList();
gvResults.DataSource = Session["results"];
on the sorting of it, i would like to be able to do this..
protected void gvResults_Sorting(object sender, GridViewSortEventArgs e)
{
...
Hi guys.
I guess this is trivial but not for me.
I have a collection MembershipUserCollection. I wanted to perform some Linq query over it so I've used OfType<MembershipUser>() method and then applied Where() on it. However, I do not know how to cast back my results to MembershipUserCollection?
This is my code:
MembershipUserCollectio...
I am building my query using PredicateBuilder from LinqKit.
it is great and does exactly what i am looking for.
To make my code more reusable (tables and views) i created a generic predicate builder class:
public class LocalPredicateBuilder<T> where T : IResort
...
var predicate = PredicateBuilder.True<T>(
which exposes BuildPre...
Hello everybody
I have a LINQ declaration like this :
var query = from foo in NHibernate_Helper.session.Linq<TheType>() select foo;
Is it possible to store TheType into a variable to dynamically define this one ?
Thank you by advance
...
I am writing code that pulls data from database tables and writes them to an XML file (to be picked up by another process). There are bout 60,000 records, and each record can have multiple entites, i.e. a member can have several contacts, each contact can have several phone numbers, etc. The entire process takes several hours, and I've n...
I just want to know if there is any known issue, or if I'm doing something wrong. Everytime I do something like the example below, I get an error "the server failed to resume the transaction".
I had already asked another question about this error, but now I've figured out it only appears in the foreach loops
//Listing orde...
Hello,
Executing the following NHibernate.Linq statement raises a "could not instantiate: Reservation001.Services.ReservationDto" NHibernate.QueryException containing an inner InvalidCast exception ("Object must implement IConvertible."):
var inOneStep = (from r in session.Linq<Models.ReservationHeader>()
select new ReservationDto(...