• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2187
  • Last Modified:

'New' cannot be used on an interface > Dim dt As New DataTable("ID") <- works on some vb forms but not on other

hi,
i've got 2 vb forms and i cannot for the love of me figure out what the difference between them are.

Dim dt As New DataTable("ID")

works on my 1 form, but not on some of the other forms
it give the ERROR : 'New' cannot be used on an interface

i searched for word interface on the page, but didnt find it.
i can copy the exact code to another vb.net page and it will work there.

pls help.
thanks!

0
jxharding
Asked:
jxharding
1 Solution
 
Fernando SotoCommented:
Hi jxharding;

In the form that it does not work try it like this:

        Dim dt As New System.Data.DataTable("ID")

It may be that you have imported other name spaces in the form that it does not work and you are getting name clash.

Fernando
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now