66 Discussion / Question Topics
Remove Filter
|
|
I have used GroupBy and have got the value as below into individual array but the array consist of 5 sets of same Id so how do group them futhure to get something like expected result below , any idea would be helpful [{ "id": 116, "amgId": 168755, "amgName": "FIT", … |
|
As I am new to Linq and Entity Framework, I don't know how I add comma sepearted and left join in linq/Entity code. My Sql query is rather big and I want it to be convert in Linq/entity: Select DISTINCT SR.StudentRequestId,SR.RegistrationId,SR.Location,SR.PaymentMethod,SR.CreatedOn,C.ClassName,CC.CampusName, CASE WHEN ISNULL(TSR.StatusId,0)=0 THEN 1 ELSE TSR.StatusId END AS … |
|
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'm using linq on a array and I need to find the index of the linq result. Is this possible? how? My thanks in advanced. This is my code: Vector3[] vertices=mesh.vertices; var V3=(from cur in vertices where (cur.x==point.PointX) && (cur.y==point.PointY) select cur).FirstOrDefault(); |
|
I have a linq statement where i turned letter grades into numbers to calculate a gpa can anyone tell me why no matter what grade i click i get the same gpa of 68 for each one? maybe someone can look over my code and give me an answer or … |
|
need to code a linq statement that codes the grade display button so it allows the user to display either all records or only records matching a specific grade. Also it has to calculate a gpa where a=4 b=3 c=2 d=1 f=0 My main problem is with a linq statement … |
|
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) … |
|
Hi, having code placed below, I cannot clue out, how to convert query in FilterData() to a dynamic query. Any ideas how to do it? Thanks in advance for any hint. Martin public class Item { public DateTime SampleDate; public List<String> Columns = new List<String>(); //this stores all columns } … |
|
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 … |
|
**I have a table with 4 columns = a(ID),b,c and d.By using LINQ, how can I calculate 'd'* 'b' / 'c' while changing 'a' with a combobox?And would it make any difference if it is a VIEW? is it a fair question? and do you need more information? ** |
|
Hi, Could someone please help me to optimize the attached code file. as i'm new to c# world. Thanks in advance cheers |
|
i am using a store procedure to access field in asp.net View, i am putting db columns in HTML table, it's workign except for one field, 'NetSalary'. It can't be accessed, it says that model doesn't contain it. i tried many ways but couldn't get to work. ALTER PROCEDURE [dbo].[GetMonthlyReport] … |
|
I have 2 below tables: tblCustomers: id customerName 1 John 2 Philip 3 Steve tblOredrs: id customerId ordId payment 1 1 100 True 2 1 101 True 3 1 102 False 4 2 101 True 5 2 102 True 6 2 103 False 7 3 101 True my condition is: … |
|
i have follwing data in datatable how to convert it to xml ErrorType UtilityType MstLocCode MDescription SubLocCode SDescription FieldName FDescription 1 Elect NM0001 XMN001 ABC ddsafs 1 Elect NM0001 XMN001 XYZ ddsafs 1 Elect NM0001 XMN001 LMN ddsafs 1 Elect NM0005 XMN002 sds 1 Elect NM0006 XMN002 fghfgh Gas ddsafs … |
|
Hi, i have these codes: Dim dt3 As New DataTable dt3.Columns.Add("AdminNo", GetType(String)) '/*Add column AdminNo dt3.Columns.Add("PaperNo", GetType(Integer)) Dim curmodule As String = String.Empty For Each dr1 As DataRow In dt1.Rows curmodule = dr1("ModuleCode").ToString For Each dr2 As DataRow In dt2.Rows Dim found As Boolean found = False For i As … |
|
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, I am trying to create an outer join in Linq using DefaultIfEmpty. It does not seem to be working. Basically I want c.TotalAmount to be 0 if it does not exist in the second/right table. Any ideas as to what I might be doing wrong? The query does execute, … |
|
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 am attempting to replace the database in an application with MariaDB. This application is written in C# and previously accessed the database (mostly inserts) with LINQ. When I attempt to insert (other transactions have the same type of issue) I get the error message: "You have an error … |
|
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 … |
|
Can anyone help me. My code is not working this is cascading drop down list. It's connected to my database. Jquery Code: <script type="text/javascript"> $(document).ready(function () { $("#SiteId").change(function () { var idDept = $(this).val(); $.getJSON("Service/GetBuildingNameList", { id: idDept }, function (myData) { var select = $("#BuildingID"); select.empty(); $.each(myData, function (index, … |
|
Hi Guys.. Hoping you can help here.. I'm dabbling with Linq as I'm wanting to pass a Node Value from the XML file into the Connection String. Currently my Code seems to be working and holding the Value in the System.(Code Below:)(Screenshot attached also) XDocument testXML = XDocument.Load("C:\\twDB.xml"); var DataBases … |
|
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 … |
The End.