Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

The record cannot be deleted or changed because table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nkw - 16 Feb 2007 15:45 GMT
Probably an ado.net issue.

I have two tables in Access obligor and Collateral, and collateral has
foreign key reference to obligor.

I created a winform to edit obligor. i tried to modify a none primary key
column and got the following error.

               this.obligorBindingSource.EndEdit();
               this.obligorTableAdapter.Update(this.ldgDataSet.Obligor);

the error shouldn't occur since no PK is modified?

System.Data.OleDb.OleDbException was unhandled
 Message="The record cannot be deleted or changed because table
'Collateral' includes related records."
 Source="Microsoft JET Database Engine"
 ErrorCode=-2147467259
 StackTrace:
      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
LGD.ldgDataSetTableAdapters.ObligorTableAdapter.Update(ObligorDataTable
dataTable) in C:\Working\crdweb\LGD\ldgDataSet.Designer.cs:line 16984
      at LGD.Obligor.btnSave_Click(Object sender, EventArgs e) in
C:\Working\crdweb\LGD\Obligor.cs:line 37
      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 LGD.Program.Main() in C:\Working\crdweb\LGD\Program.cs:line 17
      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()
RobinS - 16 Feb 2007 18:33 GMT
I already responded to this in the adonet newsgroup. Please don't
multi-post. If you want to ask the same question in multiple groups, put
all of them in the address list at once. That way, if someone in one group
answers the question, others know it, and can spend their time helping
someone else.

Robin S.
--------------------------------
> Probably an ado.net issue.
>
[quoted text clipped - 70 lines]
> executionContext, ContextCallback callback, Object state)
>       at System.Threading.ThreadHelper.ThreadStart()
nkw - 16 Feb 2007 19:35 GMT
sorry, i will search the all address posting method.

> I already responded to this in the adonet newsgroup. Please don't
> multi-post. If you want to ask the same question in multiple groups, put
[quoted text clipped - 78 lines]
> > executionContext, ContextCallback callback, Object state)
> >       at System.Threading.ThreadHelper.ThreadStart()
Otis Mukinfus - 17 Feb 2007 15:55 GMT
>Probably an ado.net issue.
>
[quoted text clipped - 64 lines]
>executionContext, ContextCallback callback, Object state)
>       at System.Threading.ThreadHelper.ThreadStart()

I notice you have a habit of posting the same question to multiple news groups.
That is considered bad form and many folks will not answer questions when they
see this behavior from a poster.

Good luck with your project,

Otis Mukinfus

http://www.otismukinfus.com
http://www.arltex.com
http://www.tomchilders.com
http://www.n5ge.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.