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

  • Home
  • SEARCH
  • 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 3308522
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:31:53+00:00 2026-05-17T21:31:53+00:00

Within my application i have a PUBLIC customer class… Public Class Customer Public Name

  • 0

Within my application i have a PUBLIC customer class…

Public Class Customer
    Public Name As String
    Public Surname As String
End Class

Then i decided to use LINQ to SQL within my application.
After adding the MyDatabase.dbml class, errors showed up since LINQ creates public properties too

<Column(Storage:="_Name", DbType:="NVarChar(50) NOT NULL", CanBeNull:=false)>  _
    Public Property Name() As String
        Get
            Return Me._Name
        End Get

Here are some errors..

'Name' is already declared as 'Public Name As String' in this class.

'SurName' is already declared as 'Public SurName As String' in this class.

Ok. Thats logical.

But what is the best-practice i should use in the future?
I would not like to use the Name and Pluralization options mentioned in ScottGu’s blog or rename the properties of my Customer class.

Is there any trick that i am missing?

  • 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-17T21:31:53+00:00Added an answer on May 17, 2026 at 9:31 pm

    Your original code didn’t have properties. It had public fields. They a bad idea, basically.

    You should just remove the original fields, and use the ones that LINQ to SQL has generated for you. Why would you want two fields (_Name and Name) storing the customer’s name, for example?

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

Sidebar

Related Questions

I have this code: public partial class App : Application { protected override void
I have an application which tries to load some expected registry settings within its
I am using Tiles within my web-application. I have a standard-layout (standard.jsp) within the
I am using the MySQL C API within a C++ application. I have a
I have a Flash application that is hosted from within a Drupal page. Some
I have an application that places several Windows within a com.extjs.gxt.desktop.client.Desktop. I need to
Within an application, I've got Secret Keys uses to calculate a hash for an
I'm going to be building an application within the next six months that will
There is an actual running Java ServerPages (JSP) application within a *NIX box which
If I need to throw an exception from within my application which of the

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.