Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 4th, 2008, 05:15 PM
Authorized User
 
Join Date: Aug 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tusharkale
Default Pass datatable to function

Hi,

I have function like
C# code
  public void ProcessRecords(DataTable agmt_process)
        {
            //bool processStatus;
            foreach (DataRow row in agmt_process.row) .... (For loop is gicing error )
...... process
}

How do I process each row ??? It say Error 2 'System.Data.DataTable' does not contain a definition for 'row'



MaskXMLInfo is my dataset name with agreementeven as one of the datatable. I want to pass this table to above function.

in my aspx page i m using this code. to pass datatable to function.

BusinessLogic thread2_obj = new BusinessLogic();
MaskXMLInfo maskEvenAgmtXML = new MaskXMLInfo();
thread2_obj.ProcessRecords(maskEvenAgmtXML.agreeme nteven);

where am i going wrong?


 
Old August 4th, 2008, 06:29 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Look here:
     http://msdn.microsoft.com/en-us/library/system.data.datatable_members(VS.80).aspx

Scroll down through the "Public Properties". You see any property there named "row"?

No? Neither do I.

Now look for a property named "Rows". Notice the upper case R.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Datatable Limno .NET Framework 1.x 0 May 28th, 2008 02:37 PM
Want to pass a row cursor to a function in a query howardb1 Access VBA 0 April 24th, 2006 03:24 PM
Is it better to pass variables to a function? stephen_c_ Beginning PHP 3 November 4th, 2005 05:07 AM
pass variable into function and retaining value mikeuk Beginning PHP 3 August 4th, 2004 06:47 AM
Return DataTable from Web Method Function kasie ASP.NET 1.0 and 1.1 Basics 2 February 11th, 2004 06:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.