5 Replies - 278 Views - Last Post: 03 August 2019 - 03:15 AM Rate Topic: -----

#1 as1981   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-August 19

Dataset question

Posted 02 August 2019 - 09:17 AM

All,

I'm used to VB6 and trying to learn vb.net.

I added a new Datasource called TestDataSet.

I am trying to access the data using the following code:

Module Module1
    Sub Main()
        Dim Test As DataSet

        Test = TestDataSet.Tables("Test")
    End Sub

End Module




The IDE complains about the TestDataSet.Tables code with "References to a non shared member requires an object reference."

Could anyone advise what I'm doing wrong?

Is This A Good Question/Topic? 0
  • +

Replies To: Dataset question

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15269
  • View blog
  • Posts: 61,223
  • Joined: 12-June 08

Re: Dataset question

Posted 02 August 2019 - 09:32 AM

What do you mean when you say you "added a new Datasource called TestDataSet"?
Was This Post Helpful? 0
  • +
  • -

#3 DarenR   User is offline

  • D.I.C Lover

Reputation: 634
  • View blog
  • Posts: 4,209
  • Joined: 12-January 10

Re: Dataset question

Posted 02 August 2019 - 09:54 AM

im not seeing where you are filling the dataset
Was This Post Helpful? 0
  • +
  • -

#4 as1981   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-August 19

Re: Dataset question

Posted 02 August 2019 - 11:49 AM

View Postmodi123_1, on 02 August 2019 - 09:32 AM, said:

What do you mean when you say you "added a new Datasource called TestDataSet"?

Thanks for your reply. Sorry I missed that information from my post. I created it using the Datasource wizard within Visual Studio 2017. I can see the tables showing in the dataset.

View PostDarenR, on 02 August 2019 - 09:54 AM, said:

im not seeing where you are filling the dataset


Thanks for your reply. I think my reply to modi123_1 answer this unless I've missed understood?
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15269
  • View blog
  • Posts: 61,223
  • Joined: 12-June 08

Re: Dataset question

Posted 02 August 2019 - 12:12 PM

I avoid the wizard and just use variations of the snippets I wrote five years ago. All you need is the correct connection string and it should get you to where you need to go.

https://www.dreaminc...-adapter-setup/
https://www.dreaminc...-command-setup/


https://connectionstrings.com
Was This Post Helpful? 0
  • +
  • -

#6 as1981   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-August 19

Re: Dataset question

Posted 03 August 2019 - 03:15 AM

Hello,

Thanks for your help.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1