Namespace without system is not supporting in for my website RRS feed

  • Question

  • this code is now not supporting for my website.

    Dim dd As Data.DataTable

    now its saying "Data table is not a member of 'Data'".

    this is working in other class of of but not for my running website.

    what i need to do for this?

    Sunday, March 29, 2020 2:56 PM

All replies

  • Hi

    What about

    Dim dd As New DataTable

    Regards Les, Livingston, Scotland

    Sunday, March 29, 2020 3:23 PM
  • why not supporting that was which was i am using? actually several time this is using in my project and suddenly stop my work. why?
    Sunday, March 29, 2020 3:25 PM
  • Between the other thread which is still not resolved and this both issues will have the same resolution.

    When the System.Data and similar DLL's don't match between development machine and runtime location e.g. a server this will happen, also if the project targets 32 bit and runs on a machine that is 64 bit this is a problem also or vice versa.

    If you can't write this

    Public Class Example
        Public Function Demo() As DataTable
        End Function
    End Class

    Then the above applies.

    See also Framework targeting overview

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Sunday, March 29, 2020 3:58 PM
  • This goes without any problem

    Imports System.Data
    Module Module1
        Private DT As Data.DataTable
    End Module

    And if it does not go, you have to set a reference to System.Data (which can be done in many ways but the easies is by selecting it in Solution Explorer standard at the right side of Visual Studio.


    Sunday, March 29, 2020 4:10 PM