473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

find the max value throw the dlink

Hi

I have a table which contain the filed

id, departmentid, sectionid, name




now i have to find the max id of the same department and section. How can get the max id through the dlink
Mar 13 '08 #1
2 1035
saran23
28
Hi

I have a table which contain the filed

id, departmentid, sectionid, name




now i have to find the max id of the same department and section. How can get the max id through the dlink

the query is

Expand|Select|Wrap|Line Numbers
  1. Select Max(id) from tablename where departmentid=sectionID
Mar 13 '08 #2
Hi

I have a table which contain the filed

id, departmentid, sectionid, name




now i have to find the max id of the same department and section. How can get the max id through the dlink

i got the answer

id = obIncidentDataContext.Incident_PersonsInvolveds.Wh ere(x => x.departmentid == departmentid && x.sectionid ==sectionid).Select(x => x.ID).Max();
Mar 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: n_o_s_p_a__m | last post by:
Can't compile. Does this mean that all functions that throw exceptions must be of return type void? examples: // won't compile: "not all code paths return a value" public override int Run() {...
7
by: Dan | last post by:
I have the need to translate values back and forth. I have created a Hashtable to do this because I don't care about intrinsic order and I want it to be a fast as possible. My only concern is...
1
by: Jim Heavey | last post by:
Hello, I am running into something strange. I am getting the following error when the program attempts to execute a particular procedure: An unhandled exception of type...
2
by: Aaron Smith | last post by:
Has anyone had their IDE do this before? I have 3 grids that are bound to related tables. They are each in their own tab page. Grid1 - DS.Table1.Table2 Grid2 - DS.Table1.Table2.Table3 Grid3 -...
13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
6
by: baibaichen | last post by:
hi , i have a string, looks like ~~ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileSystemTest", "FileSystemTest_2003.vcproj", "{ABC6E827-F34C-4E45-B384-AC33DF83803B}" ~~ what i want...
0
by: flyingchen | last post by:
using System; using System.Windows.Forms; using System.Threading; using System.ComponentModel; namespace ProgressControl.Core { public delegate object Execute(params object args); public...
30
by: =?Utf-8?B?VGhvbWFzVDIy?= | last post by:
Hello, I have an array that holds 4 values ( they contain random numbers). I would like to find the lowest value (if there is a tie i would like to find one of the tie.) then remove that value....
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.