Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error running SP with string parameter
Message
 
To
15/05/2008 16:24:54
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01317461
Message ID:
01317537
Views:
12
Willy,

>I am experiencing an error when I call a SP that requires a string parameter.
>
>I am using mmToolStripComboBox to select among a couple of filtering criteria for rows in my DataGridView.
>
>I can run the SP from SQL Management Studio with no problmes but if I call the SP from my Biz Object I get the following error:
>
>Index was out of range. Must be non-negative and less than the size of the collection.
>Parameter name: index
>
>I am enclosing the stack Trace just in case.
>
>A second question is: How can I bind the mmToolStripComboBox to a Biz object?
>
>Thanks in advance for you advice.

>
>Stack Trace
>====================================================================================
> at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
> at System.ThrowHelper.ThrowArgumentOutOfRangeException()
> at System.Collections.Generic.List`1.get_Item(Int32 index)
> at OakLeaf.MM.Main.Windows.Forms.mmBindingStrategyBase.RemoveBindingSourceDataTable(Control control, DataTable dt)
> at OakLeaf.MM.Main.Windows.Forms.mmBindingStrategyDataGrid.BindData(ImmBindingDataGrid mmGrid, DataSet ds, String tableName, mmBusinessObject bizObj)
> at OakLeaf.MM.Main.Windows.Forms.mmBindingStrategyDataGrid.BindData(ImmBindingDataGrid mmGrid, mmBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
> at OakLeaf.MM.Main.Windows.Forms.mmBindingStrategyDataGrid.BindData(ImmBindingDataGrid mmGrid, mmBaseBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
> at OakLeaf.MM.Main.Windows.Forms.mmDataGridView.OnBindData(mmBaseBusinessObject bindingSource, mmBusinessStateChangeEventArgs e)
> at OakLeaf.MM.Main.Windows.Forms.mmUIHelper.StateChangeHandlerGrid(Control control, mmBaseBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
> at OakLeaf.MM.Main.Windows.Forms.mmDataGridView.StateChangeHandler(mmBaseBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
> at OakLeaf.MM.Main.Business.mmBusinessObject.OnStateChange(mmBusinessState bizState, String tableName, Object primaryKeyValue, Object[] primaryKeyValues)
> at OakLeaf.MM.Main.Business.mmBusinessObject.CallStateChange(mmBusinessState bizState, String tableName, DataRow dr)
> at OakLeaf.MM.Main.Business.mmBusinessObject.CallStateChange(mmBusinessState bizState, String tableName)
> at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList(String command, String databaseKey, CommandType cmdType, IDbDataParameter[] cmdParams)
> at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList(String command, String databaseKey, IDbDataParameter[] cmdParams)
> at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList(String command, IDbDataParameter[] cmdParams)
> at Target.ProTrack.Business.CellDevice.GetCellDevicesByTypeName(String CellDeviceTypeName) in D:\Data\DevProjects08\ProTrack Business Objects\CellDevice\CellDevice.Partial.cs:line 28
> at Target.ProTrack.WinApp.CellDevicesListForm.tscTCellDeviceTypeName_SelectedIndexChanged(Object sender, EventArgs e) in D:\Data\DevProjects08\ProTrack\ProTrackWinApp\CellDevicesListForm.cs:line 63
> at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
> at System.Windows.Forms.ToolStripComboBox.OnSelectedIndexChanged(EventArgs e)
> at System.Windows.Forms.ToolStripComboBox.HandleSelectedIndexChanged(Object sender, EventArgs e)
> at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
> at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
> at System.Windows.Forms.ComboBox.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.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
> at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
> at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
> at System.Windows.Forms.Control.WmCommand(Message& m)
> at System.Windows.Forms.Control.WndProc(Message& m)
> at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
> at System.Windows.Forms.ToolStrip.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.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
> at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
> at System.Windows.Forms.Control.DefWndProc(Message& m)
> at System.Windows.Forms.Control.WmCommand(Message& m)
> at System.Windows.Forms.Control.WndProc(Message& m)
> at System.Windows.Forms.ComboBox.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 Target.ProTrack.WinApp.AppMainEntry.Main() in D:\Data\DevProjects08\ProTrack\ProTrackWinApp\Main.cs:line 43
>=====================================================================================

As shown by the stack trace, it's not calling the stored procedure that is causing the problem. An exception is being thrown during data binding. I recommend checking your binding settings to make sure the DataGridView data bindings are all set properly.

Regarding the mmToolStripComboBox, the ony binding available is for the control's Text property. If you need to data bind to fill the list, you can manually bind the control using standard .NET data binding.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform