473,811 Members | 3,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Get Type("System.De cimal");
string strExpr;
strExpr = "Price * Quantity";
DataColumn myColumn = new DataColumn("Tot al", myDataType, strExpr,
MappingType.Att ribute);
myColumn.AutoIn crement = false;
myColumn.ReadOn ly = true;
DataSet1.Tables["OrderDetai ls"].Columns.Add(my Column);

But I Want That
tat my colum calculed by calling some function
like this
DataColumn myColumn = new DataColumn("Tot al", myDataType,
__CallCaluledFi ledFunction(Pri ce , Quantity) , MappingType.Att ribute);
is it posible ?

Thank you in Advance
Jul 21 '05 #1
3 1545
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 DataGridColumnS tyle
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 ExpressionEngin e 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 DataGridColumnS tyle, 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.g e> schreef in bericht
news:e4******** ******@TK2MSFTN GP11.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.Get Type("System.De cimal");
string strExpr;
strExpr = "Price * Quantity";
DataColumn myColumn = new DataColumn("Tot al", myDataType, strExpr,
MappingType.Att ribute);
myColumn.AutoIn crement = false;
myColumn.ReadOn ly = true;
DataSet1.Tables["OrderDetai ls"].Columns.Add(my Column);

But I Want That
tat my colum calculed by calling some function
like this
DataColumn myColumn = new DataColumn("Tot al", myDataType,
__CallCaluledFi ledFunction(Pri ce , Quantity) , MappingType.Att ribute);
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******** ******@TK2MSFTN GP09.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
2100
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 / / But if i have a dataset of the form:
22
11605
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 some of the application programs, specifically Java Beans cannot handle the spaces after the value in CHAR fields. Is anyone else seeing this trend?
28
4069
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 the work day. The backend has a table called CLIENTS with approximately 6000 client records. Changes to data in the table are made via a frontend db Form which has CLIENTS as its record source.
6
2565
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 using User 2's Public Key. User 2 Decrypts the transmission using his Private Key to get the orignal message. Is the above correct?
10
3444
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 database or continue to process on to the next page. I am now trying to learn ASP to see if we can replace some of our applications that were written in php with an ASP alternative. However, after doing many searches on google and reading a couple...
3
288
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 (method). how i can do it ? in MSDN System.Type myDataType; myDataType = System.Type.GetType("System.Decimal");
2
1481
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 errors), to be in the same design or style which the rest of my site has been created in. I have found a script wich does the basics of what I want, but it needs a lot of modifying, and I have a few questions. Here is the script: <?php
3
1881
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 Please Please help me out how i can solve this problem. Error : ADODB.Recordset error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /grc/registration.asp, line 85
1
1162
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 part of that query so I calculate it in a different query) I have to display fields from both queries on one report. For main query I have datasource assigned to it so it works fine. However, for other fields that I want to print on same...
0
10393
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7671
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.