473,396 Members | 1,734 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.

About Calculed Fields

Dear Sirs.

I Have Question About Calculed Fields.
i have 5 Fields From Database Query And Want add 6-th Field6 that is
Calcued Based on that 5 fields. but it calculation reque call function
(method).
how i can do it ?
in MSDN
System.Type myDataType;
myDataType = System.Type.GetType("System.Decimal");
string strExpr;
strExpr = "Price * Quantity";
DataColumn myColumn = new DataColumn("Total", myDataType, strExpr,
MappingType.Attribute);
myColumn.AutoIncrement = false;
myColumn.ReadOnly = true;
DataSet1.Tables["OrderDetails"].Columns.Add(myColumn);

But I Want That
tat my colum calculed by calling some function
like this
DataColumn myColumn = new DataColumn("Total", myDataType,
__CallCaluledFiledFunction(Price , Quantity) , MappingType.Attribute);
is it posible ?

Thank you in Advance
Jul 21 '05 #1
3 1510
Check out following article:
http://www.microsoft.com/belux/nl/ms.../datagrid.mspx
Extending the DataGrid using CodeDom
The System.Windows.Forms DataGrid has several limitations, but is very
extensible. This article shows how to create a custom DataGridColumnStyle
that evaluates expressions for each row, stored in a string value, at
run-time. This can be useful if the DataGrid shows rows that have properties
that are objects themselves, or to add calculated fields. To obtain this
behavior, an ExpressionEngine is built which can compile and execute code at
run-time. To ensure ease-of-use and provide full design-time support for the
custom DataGridColumnStyle, a custom DataGrid, based on the standard
DataGrid is built too.

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Irakli Lomidze" <Ir************@access.sanet.ge> schreef in bericht
news:e4**************@TK2MSFTNGP11.phx.gbl...
Dear Sirs.

I Have Question About Calculed Fields.
i have 5 Fields From Database Query And Want add 6-th Field6 that is
Calcued Based on that 5 fields. but it calculation reque call function
(method).
how i can do it ?
in MSDN
System.Type myDataType;
myDataType = System.Type.GetType("System.Decimal");
string strExpr;
strExpr = "Price * Quantity";
DataColumn myColumn = new DataColumn("Total", myDataType, strExpr,
MappingType.Attribute);
myColumn.AutoIncrement = false;
myColumn.ReadOnly = true;
DataSet1.Tables["OrderDetails"].Columns.Add(myColumn);

But I Want That
tat my colum calculed by calling some function
like this
DataColumn myColumn = new DataColumn("Total", myDataType,
__CallCaluledFiledFunction(Price , Quantity) , MappingType.Attribute);
is it posible ?

Thank you in Advance

Jul 21 '05 #2
Cor
Hi Jan,

Nice page

My compliments

Cor

http://www.microsoft.com/belux/nl/ms.../datagrid.mspx
Jul 21 '05 #3
Thx Cor! If you're intrested, you can check out my site
(http://www.leadit.be/) for a list of recent articles.

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Cor" <no*@non.com> schreef in bericht
news:Om**************@TK2MSFTNGP09.phx.gbl...
Hi Jan,

Nice page

My compliments

Cor

http://www.microsoft.com/belux/nl/ms.../datagrid.mspx

Jul 21 '05 #4

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

Similar topics

8
by: uc_sk | last post by:
Hello All I am a newbie to PERL language...If i have a file with data of form abcd 4 {1,2,3} 3 lmn- 3 {12,18,19,22} 4 then i can read them as... ($list $listTotal $set $noElements) = split /...
22
by: jdokos | last post by:
Hello, I have a question about VARCHAR fields. Our application groups here are starting to use VARCHARs much more frequently. Even VARCHAR (2) to (9) length fields. They say this is because...
28
by: Lee Rouse | last post by:
Hello all, This is going to be a rather lengthy "question". I have an Access 2k database, separated front end/back end. Front end copies are on about 30 workstations and used frequently during...
6
by: Sahil Malik [MVP] | last post by:
Public Private Key Pairs - How do they work? ----------------------------------------------- I was looking at a presentation recently in which it was suggested that - User 1 Encrypts a message...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
3
by: Irakli Lomidze | last post by:
Dear Sirs. I Have Question About Calculed Fields. i have 5 Fields From Database Query And Want add 6-th Field6 that is Calcued Based on that 5 fields. but it calculation reque call function...
2
by: Cerebral Believer | last post by:
Hi folks, I am creating a site in FrontPage, and want to use PHP to validate a form I have created, however I would like the return of the users input (which the user reviews to check for...
3
by: rizwanrazzaq | last post by:
Hi friends here is my coding.. but i m facing one problem .. i used both mathod SQL mathod and open Record Set. but in both i m getting error massage can anyone help me out regarding thi. Please...
1
by: creative1 | last post by:
Hi everyone I have a report that displays a number of fields to display a summary report. One of the fields I want to display on my report isn't part of the main query (For some condition it can be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.