----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: contact4manoj Message 3 in Discussion Hi Yathish. To create a datatable at any point of time by code using VB.NET (which is what you seem to be using, you need to use the following command: Dim dtDemo as New System.Data.DataTable After which you can declare the various DataColumn Objects and add the desired rows. This datatable can then be added directly to the dataset at any point of time, just by issuing the following command: InventoryDataSet.Tables.Add( dtDemo ) But, since you seem to be creating a dataset in the two functions, then to transfer a table from one dataset to another, there are two ways. The first technique is to directly add the table from dataset created in the function to the other dataset. Your code in the function, would probably read like this: InventoryDataSet.Tables.Add( details2dataset.Tables(0) ) But then, this is a referential copy. Meaning, any changes you make to the InventoryDataSet's table, will be reflected in the details2dataset table. The other option, in case you do not want a referential copy, but would like a complete copy, is to use the datatable's Clone() method, in the following way: InventoryDataSet.Tables.Add( details2dataset.Tables(0).Clone() ) Hope the above explanation helps. Yours truly, MANOJ KUMAR SHARMA. ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/bdotnet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
