none
DLINQ (May 2006 CTP) and SQL Server 7: can't insert RRS feed

  • Question

  • Hello,

     

    I am trying to use LINQ Preview (May 2006 CTP) with MS SQL Server 7.0 (that's what I have...).

    At first it seemed to work well. Selections work perfect, for instance.

    But I can't insert new rows into the db. When I call SubmitChanges(), I get the following exception:

     

    Code Snippet
    System.ArgumentException was unhandled
      Message="Value does not fall within the expected range."
      Source="System.Transactions"
      StackTrace:
           at System.Transactions.Oletx.ITransactionShim.Export(UInt32 whereaboutsSize, Byte[] whereabouts, Int32& cookieIndex, UInt32& cookieSize, CoTaskMemHandle& cookieBuffer)
           at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
           at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
           at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
           at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)
           at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
           at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
           at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
           at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
           at System.Data.SqlClient.SqlConnection.Open()
           at System.Data.DLinq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
           at System.Data.DLinq.SqlClient.SqlContext.get_IsServer2KOrEarlier()
           at System.Data.DLinq.SqlClient.SqlContext.ExecuteNonQuery(Expression query)
           at System.Data.DLinq.SimpleChangeDirector.Execute(Expression command, StringBuilder changeText)
           at System.Data.DLinq.SimpleChangeDirector.ExecuteInsert(TrackedObject item, StringBuilder changeText)
           at System.Data.DLinq.SimpleChangeDirector.Insert(TrackedObject item)
           at System.Data.DLinq.ChangeProcessor.SubmitChanges(ConflictMode failureMode)
           at System.Data.DLinq.DataContext.SubmitChanges(ConflictMode failureMode)
           at System.Data.DLinq.DataContext.SubmitChanges()
           at LINQTest.Program.Main(String[] args) in c:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\DekelPublish\LINQTest\Program.cs:line 20
           at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()

     

     

    I am sure that I've filled all the necessary fields in the newly created object, because I can add such row manually to the database without any problems.

     

    How can I debug such thing? Did somebody see something like that?

    Thank you!

    Friday, April 11, 2008 9:26 AM

Answers

  • SQL Server 7 and respective OLE DB Provider isn't supported for use with the O/R Designer within Visual Studio. I know this isn't a great answer for you - sorry about that.

     

    Faisal Mohamood | Program Manager | LINQ to SQL

    Monday, April 14, 2008 11:04 PM
    Moderator

All replies

  •  

    Hi Dmitry,

     

    Not that this directly answers your question - but have you considered switching to the RTM version of LINQ to SQL? It's been quite a while since the May 2006 CTP so you might save yourself a lot of trouble by using the released version.

     

    Faisal Mohamood

    Sunday, April 13, 2008 5:29 AM
    Moderator
  •  

    Hi,

     

    That's exactly what I've tried. On the one hand, it helps because no more exceptions are thrown. On the other hand, I can't use the designer now. See details here: http://forums.microsoft.com/Forums/ShowPost.aspx?PostID=3160469&SiteID=1

     

    Thank you.

    Sunday, April 13, 2008 7:19 AM
  • SQL Server 7 and respective OLE DB Provider isn't supported for use with the O/R Designer within Visual Studio. I know this isn't a great answer for you - sorry about that.

     

    Faisal Mohamood | Program Manager | LINQ to SQL

    Monday, April 14, 2008 11:04 PM
    Moderator