29 Solved Topics
Remove Filter | |
I have a `List<double> MyList` something looking like this: 4.75/1.01/5.66/NaN/42.42/3.33 I’d like to get the minimum value of 1.01 out of it, but I get d = NaN when doing `double d = MyList.Min();` Tried, after some long internet strolls, something with LINQ to no avail. Some LINQ afictionados around … | |
Hi all I'm new using LinQ. Im having Specified Cast not Valid in this Function. Hope someone let me know what I'm doing wrong. this is the Function Private Function GroupedBy() As DataTable Dim Sales As New ds_Sales_OELI Dim dt As DataTable = Sales.Not_SCheduled GroupedBy = New DataTable Dim dr … | |
I have this Linq expression that works well. What is the right approach to test if it has returned anything? internal static void getCreditNotes(string invoiceId, out DataTable creditNotes,out double total) { total = 0; creditNotes = new DataTable(); var q = dt.AsEnumerable(). Where(r => (string) r["invoiceId"] == invoiceId && (string) … | |
I am doing ex4 from the fundamentals of C#. But I cannot solve the problem. I am unable to slice the array correctly and instead just endup with System.int32[] Simply all I am supposed to do is find the maxmimal sequence of equal consecutive elements. I am trying to follow … | |
What is the best way to get the object, within a list of that object type, that has the highest ID number? I've been trying to figure it out and I can manage to get the highest ID number but not the object containing that ID number. Any help would … | |
Hi, Could someone please help me to optimize the attached code file. as i'm new to c# world. Thanks in advance cheers | |
Hi All, I'm fairly new to using Linq but I thought I had a handle on it, apparently not though. I'm processing an XML file sent out as an error report by a third party. I have no control over this file and it has been developed to an industry … | |
Could one be preferred over the other in terms of performance? Both option have to traverse the whole array somehow to find out which string contains an 'a'. Or does it not matter much and is it just a syntax thing. Or are there better ways to do this? All … | |
Hello my fellow Daniwebies! I have a curious, possibly unique, and odd problem for everyone! We support an ASP.NET application which is using VB.NET for code behind. We use LINQ to SQL and classed object for the data retreival. I have an object called...myObject which is being deleted: Public Shared … | |
Hello folks, I'm currently studying how to use LinQ in VB.NET but I guess I'm stock. I'm using VS 2008 version (framework) 2.0 Anyone who can help me get through this?? | |
Hi, I have two LINQ queries that produce two different results, but the fields, while having different names, are essentially the same. I am trying to union them together (although concat in this case should produce the same results), but I am getting an error. My thought is that I … | |
So I have this linq code and I am trying to get it to look at the datbase and what it is doing is pulling back the last record put into the database. My asp page refreshes and displays the new information that was updated. What I want is to … | |
good morning guys, i'm developing a website. whereby have to move through records..next and previous...i did something like this public Product NextProduct(List<Product> products, Product product) { Product nextproduct = (Product)product; for (int i = 0; i < products.Count; i++) { if (Equals(products[i].ProductId, product.ProductId)) { if (products[i + 1].ProductId == null) … | |
Ok so I'm a total noob with VB.NET and I so far I've read about a thousand forums and I've yet to get a straight answer. I've read that VB treats anonymous types differently than C# (the why, beats me). I have a DataTable, and I want to return a … | |
Hey everyone, so I have this project for windows phone i have to do and I have to put some pins on a bing map, but in order to do that I make an API request to google for google places. I get back an XML file and it's like … | |
My linq query won't insert my data. What am I doing wrong? class Query { musicEntities db = new musicEntities(); public bool findArtist(string artist) { bool status = db.Artists.Any(w => w.Name.Contains(artist)); return status; } public void insertArtist(string artist) { if (findArtist(artist) == false) { Artist art = new Artist { … | |
I have a LINQ function to get 3 things :: Line, Average of Duration and Count I have a problem to sort it based on Average Of Duration column. Here is my code: Dim group2 As IEnumerable(Of DataRow) = _ From row In Ds.Tables(0).AsEnumerable() _ Group row By LINENAME = … | |
Hello my fellow DaniWebbers, I have a question for you. Problem: I am troubleshooting an ASP.NET (some one else wrote) page that has an insert form. The user can insert, using linq, into the database. I want to check the database for the values before inserting the values. (Safeguarding from … | |
Hello all. I have a question on searching a List(Of CLass). I am not sure how it is labeled List<OF T> or List(Of Class) However you label it here is the Class EXT Public Class EXT Implements IComparable Private m_extension As String Private m_exe As String Private m_description As String … | |
Hi friends., I am now try to study LINQ in C#.net which book can i refer and that is easy to learn and give perfect example code snippet | |
Hi there, I have two tables in my data entity model accessed by StaffDB. Staffs contains: StaffID FirstName LastName Address Town County Postcode YearJoined CurrentGrade Role Ratings contains: RatingID StaffID Date Rating1 (automatic to avoid conflict with table name also of rating) Comments These are linked by StaffID. I am … | |
hai , I used LINQ in application. I want to perform batch update. For that i used the code as: [CODE] int[] istudentId = new int[]; int j = 0; for (int i = 0; i < GrdStudent.Rows.Count; i++) { if ((GrdStudent.Rows[i].FindControl("chkSelect") as CheckBox).Checked) { istudentId[j] = ObjStudent.Student_Id; j++; } … | |
Hi All, I am trying to use to linq to retrieve some data, and creating my queries dynamically with where clauses added to an IQueryable object. The problem I am running into is filtering for days of the week. In the table, I have a datetime of a call. I … | |
Hey guys, I'm want to retrieve results from the database, where datetime picker given value, is equal to database value. var _check = (from day in Check.tbl_employees where day.d_from== _frm && day.d_to == _to select new { day.desg_id, }).FirstOrDefault(); datetime picker gives a value with its time,but i'm only interested … | |
Hi! I need to be able to change the location of the database at runtime through a menu in my program. My question is how to best achieve this. If for example the ip to the server change, the user need to be able to update the database path; i.e. … | |
hey, im currently creating an e-commerce store, im quite new to ASP.NET and C#. im trying to create a menu that is generated based on the database tables. i have created a stored procedure, which works correctly: [CODE] ALTER PROCEDURE dbo.getProductsForCat AS SELECT * FROM products_cat WHERE product_cat_id IN ( … | |
I'm trying to LINQ two tables based on a dynamic key. User can change key via a combo box. Key may be money, string, double, int, etc. Currently I'm getting the data just fine, but without filtering out the doubles. I can filter the double in VB, but it's slooooow. … | |
I've been working on something with alot of iteration (foreach) and now that everything is working I'd like to optimize it by changing it to link. Currently I am trying to translate this foreach code to LINQ [CODE] int count = 0; foreach( string file in Directory.GetFiles( path )) { … | |
Hi i'm creating my Data Access Layer and I want to return my object but not all the fields so this is the code i'm using [CODE] Public Function BasicSearchProposals(ByVal searchvalue As String) As IEnumerable(Of DCProposal) Dim dc As New PPDataContext() Dim proposals = From p In dc.DCProposals _ Where … |
The End.