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 4617466
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:07:41+00:00 2026-05-22T02:07:41+00:00

I have the following object: namespace LearnLINQ1 { [Table(Name=testMe)] public class SubmitTest { [Column(Name=FirstName)]

  • 0

I have the following object:

namespace LearnLINQ1
{
    [Table(Name="testMe")]
    public class SubmitTest
    {
        [Column(Name="FirstName")]
        public string FirstName { get; set; }

        [Column(Name = "LastName")]
        public string LastName { get; set; }

        [Column(Name = "PhoneNumber")]
        public int PhoneNumber { get; set; }

        linqLayerDataContext db;
    }
}

And i’ve used the same thing with a constructor:

namespace LearnLINQ1
{
    [Table(Name="testMe")]
    public class SubmitTest
    {
        [Column(Name="FirstName")]
        public string FirstName { get; set; }

        [Column(Name = "LastName")]
        public string LastName { get; set; }

        [Column(Name = "PhoneNumber")]
        public int PhoneNumber { get; set; }

        linqLayerDataContext db;

        //constructor
        public SubmitTest(string first, string last, int phone, linqLayerDataContext db)
        {
            this.FirstName = first;
            this.LastName = last;
            this.PhoneNumber = phone;
            this.db = db;
        }

    }
}

I’m using the following code to instantiate the object and attempt to add it to the database as a new record:

SubmitTest test = new SubmitTest { FirstName = "Jeremy", LastName = "Stafford", PhoneNumber = 23 };
db.testMes.InsertOnSubmit(test);

But im getting the error:

Error 1 The best overloaded method
match for
‘System.Data.Linq.Table.InsertOnSubmit(LearnLINQ1.testMe)’
has some invalid
arguments C:\Users\Jeremy\Documents\Visual
Studio
2010\Projects\LearnLINQ1\LearnLINQ1\Form1.cs 42 13 LearnLINQ1

Error 2 Argument 1: cannot convert
from ‘LearnLINQ1.SubmitTest’ to
‘LearnLINQ1.testMe’ C:\Users\Jeremy\Documents\Visual
Studio
2010\Projects\LearnLINQ1\LearnLINQ1\Form1.cs 42 39 LearnLINQ1

I’m not sure if there was something im missing in the class definition… kinda new to the concept. Can someone point me in the right direction?

================================
UPDATE: Ok so i made some changes

the customer class:

namespace LearnLINQ1
{

    public class Customer
    {
        [Table(Name = "testMe")]
        public class SubmitTest
        {
            [Column(Name = "FirstName")]
            public string FirstName { get; set; }

            [Column(Name = "LastName")]
            public string LastName { get; set; }

            [Column(Name = "PhoneNumber")]
            public int PhoneNumber { get; set; }
        }
    }
}

And the test code:

namespace LearnLINQ1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            linqTestDataContext db = new linqTestDataContext();

            Table<Customer> Customers = db.GetTable<Customer>();
            var cus = new Customer { FirstName = "Jeremy", Lastname = "Stafford", Age = 31 };
            db.Customers.InsertOnSubmit(cus);

            db.SubmitChanges();
        }
    }
}

Now the problem is with the customer class. it is giving the following error:

Error 1 Missing partial modifier on
declaration of type
‘LearnLINQ1.Customer’; another partial
declaration of this type
exists C:\Users\Jeremy\Documents\Visual
Studio
2010\Projects\LearnLINQ1\LearnLINQ1\Customer.cs 11 18 LearnLINQ1

  • 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-22T02:07:42+00:00Added an answer on May 22, 2026 at 2:07 am

    LearnLINQ1.testMe is the object you need to create not LearnLINQ1.SubmitTest

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

Sidebar

Related Questions

I have the following object: public class QueueItem { public long _id { get;
I have the following code #include <iostream> using namespace std; class Object { public:
I'm using ASP.NET MVC2 and I have the following object structure: public class IDealer
I have the following class: public class AddCouponInfoRequest : namespace.Request { } I have
In C# I have the following object: public class Item { } public class
I have the following Ria Service define: namespace SilverlightTest.Web { [EnableClientAccess()] public class ContactService
Say I have the following AR Object: namespace Models { [ActiveRecord(Lazy = true, Table
I have the following example relationship: namespace Yesod { public class Program { //
I have the following C# code. namespace MyMath { public class Arith { public
I have the following object defined function BusinessUnit(id, name, code) { this.id = ko.observable(id);

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.