I have a database with two tables customers & sales what i would like to do is in the sales datagrid is to have a total column that calculates the quantity*price columns and shows the result in the total column i don't know if i need to do this with unbound column or with a databound column i looked at the msdn2 on the mirosoft site and just got more confused hope someone can point out steps to do this. thankyou Barryt
barry t
0
Newbie Poster
Recommended Answers
Jump to Postyou create an unbound column in the sales and use the Expression property whose value is quantity*price (assuming those are the two column names). Only create bound columns if you want data saved in the database or pulled from the database (you could have created the column in your query …
Jump to Postdatabase1Dataset.Columns.Add(Column1);
that line is incorrect
Cannot add a column to a dataset... needdatabase1dataset.Tables["sales"].Columns.Add(Column1);
if sales was the table name
Jump to Postwhen do you call CalcColumn()?
You havent quite grasped the concept which is where you are going wrong but thats why we are here :)
Are you using a strong typed dataset to get your data? You dont want to add the unbound column to the grid in a grid …
All 9 Replies
f1 fan
16
Posting Whiz in Training
barry t
0
Newbie Poster
f1 fan
16
Posting Whiz in Training
barry t
0
Newbie Poster
f1 fan
16
Posting Whiz in Training
barry t
0
Newbie Poster
plazmo
1
Posting Whiz in Training
barry t
0
Newbie Poster
plazmo
1
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.