473,472 Members | 2,153 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can't use DataTable in vb.net

Hi,

I can't use DataTable!
I try to write:

Dim myDataTable As DataTable = New DataTable("ParentTable")

I then get "Type expected" for the DataTable (in Task List)
I have included "Imports System.Data"
(Tried Imports System.DataTable, and other Imports)
I have installed Framework 1.1, but if I look in "About Vb.net" it stands
framework 1.0. I have Visual Basic .net 2002 (ver 7.0 I think).
Is it to old, is there something else I have to do?

Is there an other way to show the user a table with content from xml file!?

Best Regard

-bodil-
Sep 22 '05 #1
2 1686
Bodil,

It can be that you use it in a class and not in a form.
Than you can try

Project->Add reference -> systems.data

Have a look of all kind of samplese about the datatable on our website. By
instance this one.

http://www.windowsformsdatagridhelp....9-d0e5d6bcb7e2
By the way, better newsgroups for this kind of questions in VBNet are

microsoft.public.dotnet.languages.vb
and
microsoft.public.dotnet.framework.adonet

I hope this helps,

Cor
"Bodil, Norway" <Bo*********@discussions.microsoft.com> schreef in bericht
news:3C**********************************@microsof t.com...
Hi,

I can't use DataTable!
I try to write:

Dim myDataTable As DataTable = New DataTable("ParentTable")

I then get "Type expected" for the DataTable (in Task List)
I have included "Imports System.Data"
(Tried Imports System.DataTable, and other Imports)
I have installed Framework 1.1, but if I look in "About Vb.net" it stands
framework 1.0. I have Visual Basic .net 2002 (ver 7.0 I think).
Is it to old, is there something else I have to do?

Is there an other way to show the user a table with content from xml
file!?

Best Regard

-bodil-

Sep 22 '05 #2
Hi,

Still get the same message: Type expected.
I shall post this question in microsoft.public.dotnet.framework.adonet

Thank you for you help!

Best Regards
Bodil

"Cor Ligthert [MVP]" wrote:
Bodil,

It can be that you use it in a class and not in a form.
Than you can try

Project->Add reference -> systems.data

Have a look of all kind of samplese about the datatable on our website. By
instance this one.

http://www.windowsformsdatagridhelp....9-d0e5d6bcb7e2
By the way, better newsgroups for this kind of questions in VBNet are

microsoft.public.dotnet.languages.vb
and
microsoft.public.dotnet.framework.adonet

I hope this helps,

Cor
"Bodil, Norway" <Bo*********@discussions.microsoft.com> schreef in bericht
news:3C**********************************@microsof t.com...
Hi,

I can't use DataTable!
I try to write:

Dim myDataTable As DataTable = New DataTable("ParentTable")

I then get "Type expected" for the DataTable (in Task List)
I have included "Imports System.Data"
(Tried Imports System.DataTable, and other Imports)
I have installed Framework 1.1, but if I look in "About Vb.net" it stands
framework 1.0. I have Visual Basic .net 2002 (ver 7.0 I think).
Is it to old, is there something else I have to do?

Is there an other way to show the user a table with content from xml
file!?

Best Regard

-bodil-


Sep 23 '05 #3

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

Similar topics

3
by: Dave Veeneman | last post by:
I am just getting into the WinForms data grid, and just about everything I am seeing on it seems to say that the grid must be bound to an ADO.Net dataset. I want to use the grid as a simple unbound...
1
by: VMI | last post by:
Is it possible to store the data in a datatable in the hard disk instead of the memory? By default, when a datatable's being filled, the table (and data) will remain in memory. Would it be possible...
2
by: Newbie | last post by:
Im getting an exception: System.FormatException: Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at...
3
by: Pradeep | last post by:
Hi, I am storing the DataTable in a ViewState. ViewState("mydata") = dsRedemption.T_Redemption_Dtl Then I am casting the ViewState into a DataTable variable. Dim x As New DataTable x =...
0
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these...
4
by: Rich | last post by:
Hello, I need to store various values that I will need to look up later on. I have been using hashtables and arraylists. But I can only store 2 items per row in a hashtable - key, value, and...
6
by: Pete Wittig | last post by:
Hi, I have a DataTable and I want to get a subset of the rows within it. I use the Select method to get my subset and the results are in a DataRow. I want to put those Rows back into a...
1
by: Maxwell2006 | last post by:
Hi, I am working with strongly typed datatables. What is the most efficient way to build a new DataTAble based on the result of DataTable.Select? At this point I use a foreach loop to do the...
4
by: Joseph Geretz | last post by:
I don't get it. A DataTable can't be returned, but a DataSet can. Yet a DataSet contains one or more DataTables. So obviously a DataTable must be serializable. So why not just let me return a...
9
by: xiao | last post by:
It always dumped when I tried to run it... But it compiles OK. What I want to do is to do a test: Read information from a .dat file and then write it to another file. The original DAT file is...
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...
1
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...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.