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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:46:33+00:00 2026-05-31T07:46:33+00:00

I am using Linq To Sql to insert few data to a table in

  • 0

I am using Linq To Sql to insert few data to a table in Sql server 2008.

            memadd.add_id = Convert.ToDecimal(resadd);
            memadd.mem_add = txtResAdd.Text;
            memadd.tel_no1 =Convert.ToDecimal(txtResTelNo.Text);
            memadd.mob_no1 = Convert.ToDecimal(txtResMobNo.Text);
            memadd.state = drpResState.Text;
            memadd.city = drpResCity.Text;
            memadd.pin_no = Convert.ToDecimal(txtResPinNo.Text);
            dt.mem_addresses.InsertOnSubmit(memadd);
            dt.SubmitChanges(); 

My issue here is that when i insert data into the field , it gives me an error saying

Can't perform Create, Update or Delete operations on 'Table(mem_address)' because it has no primary key.

I have a situation wherein i cant set primary key to that table .Can anyone please point me out what needs to be done here.
Thanks

  • 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-31T07:46:34+00:00Added an answer on May 31, 2026 at 7:46 am

    Just tell the memadd table in the DBML designer to select add_id as a PK for example.

    It needs not be on the database itself.

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

Sidebar

Related Questions

I am using LINQ to SQL to insert simple data into a table WITHOUT
Am creating a table with sql server 2008 and using linq to sql. Am
I am using LINQ to SQL (SQL Server) with C#. I have a table
using Linq-to-SQL I'd like to prefetch some data. 1) the common solution is to
I am using LINQ to SQL with Sql Server Compact Edition 3.5 and VS2008.
I am using LINQ to SQL with single table inheritance for an audit log.
After I do an insert using linq to sql, can I get the Identity_scope
I want to insert data into sql table in silverlight application. I know how
I am trying to insert a new entity using LINQ-to-SQL, and entity is associated
How do i put a nested insert into database using Linq to SQL my

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.