Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET 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 November 9th, 2008, 10:10 AM
Authorized User
 
Join Date: Sep 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default where this kind datatable created

hi to all friends out there.

I have one doubt that when we write in vb.net as
Dim d1 as datatable and then i create row and column by datarow and data column.
can some one tell me that when we do this where this table create and in which database it get create.

Thank you in advance.

please reply soon


 
Old November 9th, 2008, 11:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

The table isn't created in a database; its created in memory.

The DataTable, DataRow and DataColumn classes are all reference types. Reference types are always allocated from the managed heap.

'Dim d1 As New DataTable()' declares and allocates storage space for the variable 'd1' on the managed heap. The New operator returns the memory address of the object. So you're not working with a table in a database at this point, you're working with a bunch of bits stored in memory.

To create a table in a database, you would need to execute a data definintion language query using something like:

SqlCommand DDLCommand = myConnection.CreateCommand();
DDLCommand.CommandText = "CREATE TABLE MyTable (COL1 integer)";
DDLCommand.ExecuteNonQuery();

Read up a bit on the fundamentals of working with types (primitive, value and reference) and the .NET Common Language Runtime. It'll all become clearer.

HTH,

Bob


 
Old November 10th, 2008, 11:22 AM
Authorized User
 
Join Date: Sep 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks allot Bob for your reply . Even i was thinking that but just i wanted to confirm.

Thanks again.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Has anyone experienced this kind of thing? jared_edge C++ Programming 1 September 18th, 2006 03:55 PM
kind of Really strange problem kalchev ASP.NET 2.0 Basics 1 March 22nd, 2006 03:32 PM
HI I NEED TO KNOW WHAT KIND OF PROGRAM skoob Java Espanol 0 May 4th, 2005 03:07 PM
How to create this kind of application? spark Classic ASP Basics 1 April 27th, 2005 05:46 PM





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