locked
SP1 broke my data context RRS feed

  • Question

  • I have some code that was working before I "Upgraded" to SP1 and now it does not work.

    I have an EDM that is exposed over ADO.NET Data services. I have generated the client side classes using the 

    DataSvcUtil.exe utility.

    I then attempt to open a connection:

     

    ExtractionTempEntities ctx = new ExtractionTempEntities(new Uri("http://localhost:1258/DataService.svc/",UriKind.Absolute));

     

     

    In SP1beta, this worked. Now I recieve:

     

    System.ArgumentException was unhandled
      Message="Format of the initialization string does not conform to specification starting at index 0."
      Source="System.Data"
      StackTrace:
           at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
           at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
           at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)
           at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
           at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
           at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
           at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)
           at XMLCodeExtractor.Core.ExtractionTempEntities..ctor(String connectionString) in C:\CodeBase\BetaCode\XMLCodeExtractor\XMLCodeExtractor.Core\ExtractionTemp.Designer.cs:line 37
           at XMLCodeExtractor.Core.CategoryRecorder.SaveAllAsNew() in C:\CodeBase\BetaCode\XMLCodeExtractor\XMLCodeExtractor.Core\CategoryRecorder.cs:line 34
           at XMLCodeExtractor.Form1.button1_Click(Object sender, EventArgs e) in C:\CodeBase\BetaCode\XMLCodeExtractor\XMLCodeExtractor\Form1.cs:line 28
           at System.Windows.Forms.Control.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnClick(EventArgs e)
           at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
           at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.ButtonBase.WndProc(Message& m)
           at System.Windows.Forms.Button.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(Form mainForm)
           at XMLCodeExtractor.Program.Main() in C:\CodeBase\BetaCode\XMLCodeExtractor\XMLCodeExtractor\Program.cs:line 18
           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()
      InnerException:

     

    I have changed nothing in my code.

    I have scoured the net with no luck at all. I tried to find the documentation online only to find that the docs online are from November 2007 (Sad) and my code matches the sample code 100%. (After blowing 2 days on this *** I am giving up untill I can get some help from MS) I shouldn't have to open a support ticket because a simple function doesn't work and the documentation is very old.

     

    I would think that opening a Data services connection from code would be on the testing list... but that's me.

     

    Wednesday, August 27, 2008 4:19 PM

Answers

  • Looking at the error message, it looks like something is wrong with the connection string. The connection string must be in the config file.

     

    Can you try creating a new Edm project again? And then compare the connection string and see what the difference is. Hopefully this should tell you what the problem is?

     

    Thanks

    Pratik

     

    P.S. I am deleting the other thread, since its the duplicate.

    Wednesday, August 27, 2008 4:59 PM
    Moderator

All replies

  • Looking at the error message, it looks like something is wrong with the connection string. The connection string must be in the config file.

     

    Can you try creating a new Edm project again? And then compare the connection string and see what the difference is. Hopefully this should tell you what the problem is?

     

    Thanks

    Pratik

     

    P.S. I am deleting the other thread, since its the duplicate.

    Wednesday, August 27, 2008 4:59 PM
    Moderator
  •  

    I will create the Model but I doubt that is not the issue because I can query the model directly from the browser with No issues. I call http://localhost:1258/DataService.svc/Category? and I get back a full result set.

    Wednesday, August 27, 2008 6:41 PM
  •  

    I recreated the EDM and it produced exactly the same connection string:

     

    <connectionStrings><add name="ExtractionTempEntities" connectionString="metadata=res://*/ExtractionTemp.csdl|res://*/ExtractionTemp.ssdl|res://*/ExtractionTemp.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=MyDevBox\SQLEXPRESS;Initial Catalog=ExtractionTemp;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /></connectionStrings>

    Wednesday, August 27, 2008 6:58 PM