Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleted row information cannot be accessed through the r
Message
From
23/02/2006 09:10:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/02/2006 07:19:15
Rene Lovino
Bigfoot Global Solutions, Inc
Cebu, Philippines
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01098407
Message ID:
01098458
Views:
14
>Hi All,
>
>I have encountered error "'Deleted row information cannot be accessed through the row." when saving data.
>
>Below is the sample of my code.
>
>
>using System;
>using System.Drawing;
>using System.Collections;
>using System.ComponentModel;
>using System.Windows.Forms;
>using System.Data;
>using System.Data.SqlClient;
>using System.Data.OleDb;
>
>namespace SampleCode
>{
> ///
> /// Summary description for Form1.
> ///

> public class Form1 : System.Windows.Forms.Form
> {
> private System.Windows.Forms.Button buttonLoad;
> private System.Windows.Forms.Button buttonDelete;
>
> private SqlConnection objCnn = new SqlConnection("server=dbasrv03;Trusted_Connection=yes;database=northwind");
> private SqlDataAdapter objDataAdapter = new SqlDataAdapter();
> private DataSet objDataSet = new DataSet();
> private DataRow objDataRow;
> private SqlParameter workParam = null;
>
> // some c# generated code
>
> private void buttonLoad_Click(object sender, System.EventArgs e)
> {
> string lcSqlCmd;
>
> lcSqlCmd = "Select RegionID, RegionDescription from Region where RegionID = 123" ;
> objDataAdapter.SelectCommand = new SqlCommand(lcSqlCmd, objCnn);
> objDataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
> objDataAdapter.Fill(objDataSet, "Region");
> objDataRow = objDataSet.Tables["Region"].Rows.Find(1);
> }
> private void buttonDelete_Click(object sender, System.EventArgs e)
> {
> objDataSet.Tables["Region"].Rows[0].Delete();
> objDataAdapter.Update(objDataSet, "Region");
> }
> }
>}
>
>Any idea about this problem.
>The error occurs when i click the delete button.
>
>TIA,
>
>Rene

acceptchanges first. Better yet move update to another place so you have a chance to accept or reject pending deletions.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform