473,414 Members | 1,631 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,414 software developers and data experts.

Using Max and Sum on a Dataset - Possible?

What is wrong with this?
Dim strFindMax As String = "max(ProfileID)"

Dim drFindMax As DataRow() = DSet.Tables("Profiles").Select(strFindMax)

I get an error saying strFindMax does not evaluate to a Boolean. What I
really want to do is
Dim intFindMax As Integer = DSet.Tables("Profiles").Select(strFindMax)

Same thing wth Sum. Any ideas on how I can do this, or if there is any
other way?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
Jun 27 '08 #1
2 1358
It seems you confuse the Select and Compute methods
(http://msdn.microsoft.com/en-us/libr...compute.aspx.)...

--
Patrice

"Anil Gupte" <an*******@icinema.coma écrit dans le message de groupe de
discussion : uM**************@TK2MSFTNGP03.phx.gbl...
What is wrong with this?
Dim strFindMax As String = "max(ProfileID)"

Dim drFindMax As DataRow() = DSet.Tables("Profiles").Select(strFindMax)

I get an error saying strFindMax does not evaluate to a Boolean. What I
really want to do is
Dim intFindMax As Integer = DSet.Tables("Profiles").Select(strFindMax)

Same thing wth Sum. Any ideas on how I can do this, or if there is any
other way?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
Jun 27 '08 #2
Ah Thanx! In regular SQL, you use Select Max(FiledName) so I just thought
it would work. Thanx a lot for your help.

--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
"Patrice" <http://www.chez.com/scribe/wrote in message
news:05**********************************@microsof t.com...
It seems you confuse the Select and Compute methods
(http://msdn.microsoft.com/en-us/libr...compute.aspx.)...

--
Patrice

"Anil Gupte" <an*******@icinema.coma écrit dans le message de groupe de
discussion : uM**************@TK2MSFTNGP03.phx.gbl...
>What is wrong with this?
Dim strFindMax As String = "max(ProfileID)"

Dim drFindMax As DataRow() = DSet.Tables("Profiles").Select(strFindMax)

I get an error saying strFindMax does not evaluate to a Boolean. What I
really want to do is
Dim intFindMax As Integer = DSet.Tables("Profiles").Select(strFindMax)

Same thing wth Sum. Any ideas on how I can do this, or if there is any
other way?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: The Bear | last post by:
After a dataset has been populated from a text file, is it possible to update a text file from a dataset once changes are made? TB
4
by: Steve Le Monnier | last post by:
The ADO.NET DataSet is idea for application development, especially if you need disconnected data. DataReader objects are great in the connected environment but are forward only. What do you do...
0
by: Dave | last post by:
Tried posting in the Winform Forum without much luck, so posting here... After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row that is...
6
by: Barry | last post by:
Hi, I have created a dataset programmatically. I want to be able to run sql statements on this if possible, however I can't seem to get around the fact that I have to set up a connection, problem...
4
by: Peter Proost | last post by:
Hello group, what would be the best way to do the next thing: I've got a grid form with about 15000 records, when I double click a row a detail form is opened and the user can modify and save...
6
by: chreo | last post by:
Sorry for weird title and sorry for my English (I'm from Poland). This is the problem: I have form with many controls. There are three comboboxes - each should have table STREETS as DataSource....
1
by: Dhruba Bandopadhyay | last post by:
I have a DataGrid which has checkbox columns. The data source is a run-time created data set that I store in a session so I can rebind it during postbacks. I don't have a database or xml file, etc....
12
by: Simon | last post by:
Hi all, I'm having a baffling problem with a windows service that I'm working on. Basically, I am using a typed dataset to insert a large number of rows into an SQL Server 2005 database. But...
12
by: Andy B | last post by:
I need to custom build and use a dataset in c# to use with xml. Does anybody know where I can find out how to do something like this? I was going to create a class that generated the dataset and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.