|
-
Jan 1st, 2003, 10:54 AM
#1
Thread Starter
Member
Can you avg. a column in a datatable?[RESOLVED]
Hello. Is there a way to avg. a specific column in a datatable then display the results in the datagrid? Also, i am building a reports application. Whats the best feature to use in vb.net that isn't a third party software or add in. I am thinking about using a dataview and then SQL select statements to allow the user to select the report criteria. Much thanks!
Nintendo_Wizard
Last edited by Nintendo_Wizard; Jan 16th, 2003 at 12:27 PM.
-
Jan 2nd, 2003, 09:05 AM
#2
Frenzied Member
Select Avg(mytable.mycolmn) As clmAvg from .....
See some SQL tutorials like this for more help on aggregate functions.
There is an article on printing in .NET available in MSDN.
-
Jan 2nd, 2003, 10:53 AM
#3
Thread Starter
Member
Thanks Lunatic3! That SQL site helped out alot! I was leaving off the ; at the end. One quick question, you could save me alot of trial & error. How do I assign the AVG- value to a new row in a datagrid. If that's not possible how can I assign it to a label? Thanks for all your help!
-
Jan 2nd, 2003, 11:49 AM
#4
Frenzied Member
Well it needs that you have some basic knowledge ADO.NET and various data providers for windows forms in VB.NET. To put it in a nutshell you may add a DATAADAPTER to your form, generate a DATASET and then work with the data in the dataset. Your dataadapter select statment may include that avg function. I strongly recommend you to take a look at MSDN for further information on how to work with databases in .NET
-
Jan 2nd, 2003, 02:48 PM
#5
Thread Starter
Member
I'm familar with ADO.net. I think I can figure it out. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|