Note that there are some explanatory texts on larger screens.

plurals
  1. POLINQ to SQL SubmitChanges() not work to insert new record
    primarykey
    data
    text
    <p>First, I'm pretty new to LINQ to SQL, so this is probably a dumb question, but I'm trying to insert a new record into the database and I keep getting the following error: </p> <pre><code>The client was unable to establish a connection because of an error during connection initialization process before login. Possible causes include the following: the client tried to connect to an unsupported version of SQL Server; the server was too busy to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. (provider: Shared Memory Provider, error: 0 - The handle is invalid.) </code></pre> <p>I can step through my code and see that all the data is present as I would expect it to, but when it hits the</p> <pre><code>db.SubmitChanges() </code></pre> <p>in the method below I get the error. What am I doing wrong? This is SOO frustrating and I've lost a day trying to figure out LINQ to SQL... I'm half tempted to just bag it and go back to using ADO.NET and stored procs.</p> <pre><code>public static void Save(Customer customerToSave) { IpmDatabaseDataContext db = new IpmDatabaseDataContext(); db.Customers.InsertOnSubmit(customerToSave); // commit the changes to the db db.SubmitChanges(); } </code></pre> <p>In my app.config it has this connection string:</p> <pre><code>&lt;connectionStrings&gt; &lt;add name="IPM.Business.Properties.Settings.IPMConnectionString" connectionString="Data Source=socrates\sqlexpress;Initial Catalog=IPM;Integrated Security=True" providerName="System.Data.SqlClient" /&gt; &lt;/connectionStrings&gt; </code></pre> <p>I am still on my dev machine, so this is the correct connection string.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload