Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6090291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:11:51+00:00 2026-05-23T12:11:51+00:00

I am trying to write a class library and I am getting the following

  • 0

I am trying to write a class library and I am getting the following error:
“Value of type ‘WorkMateLib.Login’ cannot be converted to ‘1-dimensional array of WorkMateLib.Login'”

The code of the classes is as follows:

Public Class Logins
    Public CurrentUser As Login()
    Public Sub New()
        CurrentUser = New Login()
    End Sub
    Public Function Authenticate(ByVal id As String, ByVal pw As String)
        Dim adpt As New WorkMateDataSetTableAdapters.LoginsTableAdapter
        For Each k As WorkMateDataSet.LoginsRow In adpt.GetDataByUserName(id)
            If String.Equals(k.UserPW, pw) Then
                CurrentUser = New Login(k.UserName, k.UserPW, k.UserType)
                Return CurrentUser
                Exit Function
            End If
        Next
        CurrentUser = Nothing
        Return Nothing
    End Function

End Class

Public Class Login
    Private _UserName As String
    Private _UserPW As String
    Private _UserType As String
    Property UserName
        Get
            Return _UserName
        End Get
        Set(value)
            _UserName = value
        End Set
    End Property
    Property UserPW
        Get
            Return _UserPW
        End Get
        Set(value)
            _UserPW = value
        End Set
    End Property
    Property UserType
        Get
            Return _UserType
        End Get
        Set(value)
            _UserType = value
        End Set
    End Property
    Public Sub New()
        UserName = ""
        UserPW = ""
        UserType = ""
    End Sub
    Public Sub New(ByVal Namee As String, ByVal pw As String, ByVal typee As String)
        UserName = Namee
        UserPW = pw
        UserType = typee
    End Sub

End Class

Thanks for the help in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:11:52+00:00Added an answer on May 23, 2026 at 12:11 pm

    It should just be

    Dim CurrentUser as Login
    

    Adding the () to the end of the Type changes it to an Array of the Type.

    You should really be declaring the variable as

    Dim CurrentUser As Login = New Login
    

    As this will instantiate an instance of the Login object and assign it to the CurrentUser Variable. Currently you are just creating a Variable that is a Login type but giving it no value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a small class library for a C++ course. I was
I'm trying to write a class in Delphi 2007 that uses a ActiveX library.
I'm trying to write my first iterator class / container type. Basically, I want
I am trying to write a custom actions class library for my WiX install
I am trying to write a class for an Arduino library. I am having
I am trying to write a class library that can catch the windows messages
I am trying to write an Setup Project/Installer for a class library driver that
I am trying to write a Java class to extract a large zip file
I'm trying to write a generic class which contains a generic TObjectList< T >
I was trying to write up a class in c++, and I came across

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.