JIT

I have tried to bind som data to at windows form from sqlserver 2000 in th new visual studio 2005 beta. It works ok but when I try to change the data a window displays saying unhandeld exception has occurred...Update requires a valid updatecommand when passed DataRow collection with modified rows. The details of the error looks like this? I have tried to enable the JIT in both the machine config and later in app.config - nothing works.
See the end of this message, instead of this dialog box, for details on invoking
just-in-time (JIT) debugging.

************** Exception Text **************
System.InvalidOperationException: Update requires a valid UpdateCommand when passed DataRow collection with modified rows.
at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
at AVSHOPNY.AVSHOPDataSetTableAdapters.AfdelingerTableAdapter.Update(AfdelingerDataTable dataTable) in C:\Documents and Settings\Peter\Dokumenter\Visual Studio\Projects\AVSHOPNY\AVSHOPNY\AVSHOPDataSet.Designer.vb:line 838
at AVSHOPNY.Form2.bindingNavigatorSaveItem_Click(Object sender, EventArgs e) in C:\Documents and Settings\Peter\Dokumenter\Visual Studio\Projects\AVSHOPNY\AVSHOPNY\Form2.vb:line 6
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50215/mscorlib.dll
-
AVSHOPNY
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:file:///C:/Documents%20and%20Settings/Peter/Dokumenter/Visual%20Studio/Projects/AVSHOPNY/AVSHOPNY/bin/Debug/AVSHOPNY.exe
-
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
-
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
-
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
-
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
-
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
-
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
-
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
-
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
-
System.Deployment
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
-
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
-
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50215.44 (beta2.050215-4400)
CodeBase:file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
-

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


[9580 byte] By [PeterSpanien] at [2008-2-22]
# 1
Hi Peter,
This usually happens becuase one of the TableAdapter commands isn't configured related to the update commands. If you look at the properties of the TableAdapter Insert, Update or Delete commands on the DataSet designer, you'll likely find these are empty.
Having a TableAdapter without update commands usually is the result of using a table without a primary key, or using a sproc, but not specifying the insert, update or delete sprocs.

We've actually seen this enough that post B2 we will no longer generate the update method on the tableadapter and disable the save button on the binding navigator if the tableadapter can't be updated.

Steve Lasker
Program Manager
Data Design-Time for Client Apps
Blogs @ http://blogs.msdn.com/vbteam/archive/category/4754.aspx

SteveLasker-MS at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 2
Hi Steve,
Super - just set a primary key and it works

Thanks

Peter

PeterSpanien at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 3
If you don't mind, I have the same problem with VS 2K3. I'm sucking data off a SQL database but upon creating the sqldataadaper, it says it cannot determine which columns uniquely ID the rows for the table. Obviously it wants a primary key, so my question is this: how do I define a PK in SQL Server 2K? Thanks.
Mobius17 at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...