473,395 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1684
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...

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.