Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Strongly Typed DataSet Objects VB.Net

  • 03-02-2006 11:44AM
    #1
    Registered Users, Registered Users 2 Posts: 8,577 ✭✭✭


    I am trying to create a DataSet in a Class but getting the error declaraion expected but when i move the code into the form it working fine.

    I have the following at getting the error in red.

    Can someone help me out please why it works under the form and not in a class

    Imports System.Data.OleDb
    Imports System.Data

    Public Class ApartmentQuote

    Dim da As New OleDb.OleDbDataAdapter

    Dim ds As New DataSet

    ds.datasetname = "Apartment"


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Are you using the correct namespaces in the class? It would be handy if you posted the offending classes code entire.

    Use the code tags too, that the # symbol when you're posting.


  • Registered Users, Registered Users 2 Posts: 2,082 ✭✭✭Tobias Greeshman


    Have you got the code that causing the problems in one of the classes methods, like a constructor?


  • Registered Users, Registered Users 2 Posts: 2,758 ✭✭✭Peace


    Without the code its impossible to tell. It could because of the scope of the variable ds.

    Post code post code....:v:


  • Registered Users, Registered Users 2 Posts: 8,577 ✭✭✭Trampas


    I got it

    Sub problem.

    Thanks


Advertisement