locked
Error: Cannot obtain the value for command parameter @guid RRS feed

  • Question

  • Hi,

     

    I'm looking at using the Sync framework in a new project, and I'm trying to get the sample 'SQLExpressProviderSample' to work with my database/tables etc.

     

    I've changed all the code pertaining to the new tables and stored procedures, but keep getting this error.

     

    I've seen from previous posts that somebody said you can't use an identity field.  This field is a uniqueidentifier.  I don't know if that makes any difference or not.  Documentation for this framework is more of a 'try it and see'.

     

    Thanks for your help.

     

    Martin

    • Moved by Max Wang_1983 Thursday, April 21, 2011 6:01 PM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Monday, November 24, 2008 7:30 PM

Answers

  • Martin's problem was solved offline. The enumeration query did not include the new column in its result set so the apply command failed when trying to fill the parameter for the new column in the Insert commands.

     

    Tuesday, December 2, 2008 8:55 PM
    Moderator

All replies

  • Hello,

     

    Could you provider the stack trace for the error, and possibly the relevant code? This would help us determine the cause of the problem.

     

    Thanks,

     

    Patrick

    Monday, December 1, 2008 6:13 AM
  • Hi Patrick,

     

    Here's the stack trace for the error.

     

    A first chance exception of type 'Microsoft.Synchronization.Data.SessionVariableException' occurred in Microsoft.Synchronization.Data.Server.dll

    Stack trace for this level: at SQLExpressProviderSample.SyncForm.buttonSynchronize_Click(Object sender, EventArgs e) in C:\Users\mruss\Documents\Visual Studio 2008\Projects\Sync 2.0 Projects\Sync101 E\SQLExpressProviderSample\Sample\SyncForm.cs:line 122

    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 SQLExpressProviderSample.Program.Main() in C:\Users\mruss\Documents\Visual Studio 2008\Projects\Sync 2.0 Projects\Sync101 E\SQLExpressProviderSample\Sample\Program.cs:line 29

    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()

    Stack trace built with next level frame: at System.Windows.Forms.Control.OnClick(EventArgs e)

    Stack trace built from the next level up: 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 SQLExpressProviderSample.Program.Main() in C:\Users\mruss\Documents\Visual Studio 2008\Projects\Sync 2.0 Projects\Sync101 E\SQLExpressProviderSample\Sample\Program.cs:line 29

    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 can provide the modified code-sample being used, as well as the database schema if you need it.  Please let me know where to send if required.

     

    Thanks,

     

    Martin Russ

    Monday, December 1, 2008 4:07 PM
  • We (Martin and the sync team) are resolving this offline. We will update this thread with the outcome.

    Tuesday, December 2, 2008 5:45 AM
    Moderator
  • Martin's problem was solved offline. The enumeration query did not include the new column in its result set so the apply command failed when trying to fill the parameter for the new column in the Insert commands.

     

    Tuesday, December 2, 2008 8:55 PM
    Moderator