Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 31st, 2004, 05:24 AM
swanagetown swanagetown is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 1 swanagetown User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
vb - calculations using datagrid

I've just realised I can't implement what I'm trying to do using VB and the Datagrid control but I don't know which way to turn please help.

Basically I need 2 textboxes where the user can enter details. One of these is then used in a "function" to retrieve data from mssql. The second textbox should then be used to perform a numerical calculation on the dataset(ie. 100000 * 0.45) The 100000 is from the textbox and the 0.45 is from one of the row is mssql. There could be 10 row or more and not all with a value of 0.45.

Initially I was hoping to use the datgrid with an unbound column so that the results of the calculation could be returned in the column for each row. However this doesn't appear to be possible.

The final result would look something like this:

Rate Results
0.45 45000
0.50 50000
0.95 95000
etc...

Can anybody point me in the right direction

Reply With Quote
  #2  
Old December 31st, 2004, 02:38 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 23 m 39 sec
Reputation Power: 181
I don't understand where the datagrid enters in this picture. Post some of the code that's giving you a problem.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old December 31st, 2004, 03:06 PM
blicci's Avatar
blicci blicci is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Philly
Posts: 351 blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level)blicci User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 22 h 8 m 5 sec
Reputation Power: 52
One Solution might be to add another column to your dataset table that will hold the calculated value. Then when your dataset is updated you can catch it in the row_changed event or column_changed event of the table then rebind your datagrid.

Reply With Quote
  #4  
Old January 5th, 2005, 11:27 PM
Sony Sony is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Bangalore,India
Posts: 180 Sony User rank is Sergeant (500 - 2000 Reputation Level)Sony User rank is Sergeant (500 - 2000 Reputation Level)Sony User rank is Sergeant (500 - 2000 Reputation Level)Sony User rank is Sergeant (500 - 2000 Reputation Level)Sony User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 18 h 53 m 42 sec
Reputation Power: 15
yes Doug i dont understand why swanagetown needs a datagrid here
u can take textbox or any other control when u want to update the data
in the table whose data is populated in teh datagrid.

Kindly Post specific code and mistake u wish to clarify
Sony

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > vb - calculations using datagrid


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT