70 Topics

Member Avatar for
Member Avatar for kamilacbe

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", …

Member Avatar for pritaeas
0
242
Member Avatar for mitesh.24jain

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 …

Member Avatar for rproffitt
0
441
Member Avatar for ddanbe

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 …

Member Avatar for ddanbe
0
255
Member Avatar for VIPER5646

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 …

Member Avatar for VIPER5646
0
1K
Member Avatar for game4tress

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();

Member Avatar for ddanbe
0
281
Member Avatar for karodhill

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 …

Member Avatar for djjeavons
0
297
Member Avatar for karodhill

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 …

Member Avatar for karodhill
0
348
Member Avatar for DaveAmour

# Performing Selective Includes in Entity Framework with the Fluent API # When we are using Entity Framework as our data access choice to work with SQL Server then there are some potential pitfalls. One of these pitfalls is doing selective includes. What do I mean by selective includes? To …

1
4K
Member Avatar for PerplexedB

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) …

Member Avatar for PerplexedB
0
212
Member Avatar for martin3885

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 } …

Member Avatar for martin3885
0
1K
Member Avatar for flebber

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 …

Member Avatar for ddanbe
0
275
Member Avatar for ChrisHunter

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 …

Member Avatar for Ketsuekiame
0
235
Member Avatar for pirat4e

**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? **

Member Avatar for pritaeas
0
180
Member Avatar for balamurugan.rajendran.14

Hi, Could someone please help me to optimize the attached code file. as i'm new to c# world. Thanks in advance cheers

Member Avatar for JorgeM
0
222
Member Avatar for HunainHafeez

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] …

Member Avatar for BMXDad
0
223
Member Avatar for Mohammad_10

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: …

Member Avatar for Mohammad_10
0
241
Member Avatar for pritesh2010

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 …

0
174
Member Avatar for Fangling

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 …

Member Avatar for Fangling
0
972
Member Avatar for G_Waddell

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 …

Member Avatar for G_Waddell
0
613
Member Avatar for ddanbe

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 …

Member Avatar for Ketsuekiame
0
282
Member Avatar for Begginnerdev

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 …

Member Avatar for Begginnerdev
0
267
Member Avatar for jkvt

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, …

Member Avatar for jkvt
0
313
Member Avatar for GeekPlease

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??

Member Avatar for GeekPlease
0
283
Member Avatar for JDoggieIII

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 …

Member Avatar for Ketsuekiame
0
1K
Member Avatar for jkvt

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 …

Member Avatar for jkvt
0
4K
Member Avatar for Kratoswoo

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 …

Member Avatar for Kratoswoo
0
221
Member Avatar for goco17

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) …

Member Avatar for goco17
0
195
Member Avatar for charlybones

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 …

Member Avatar for Begginnerdev
0
3K
Member Avatar for ryan311

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, …

Member Avatar for LastMitch
0
434
Member Avatar for sundog1

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 …

Member Avatar for Ketsuekiame
0
254

The End.