473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

RowNotInTableException when accessing

Hi, I faced a problem when trying to access row again.

I have TreeView component and in Tag property I put row from datatable:

Expand|Select|Wrap|Line Numbers
  1. foreach (DataRow row in catalogDataSet.category)
  2.             {
  3.                 if (row["parent"].ToString().Equals("0"))
  4.                 {
  5.                     TreeNode node = new TreeNode();
  6.                     node.Text = row["name"].ToString();
  7.                     node.Tag = row;
  8.                     string nodeId = row["id"].ToString();
  9.                     if (this.HasChilds(nodeId))
  10.                     {
  11.                         this.fillChilds(nodeId, node);
  12.                     }
  13.                     tree.Nodes.Add(node);
  14.                 }
  15.  
  16.             }
Then I try to access row`s id:

Expand|Select|Wrap|Line Numbers
  1. int locationId = int.Parse(((DataRow)locationTreeView.SelectedNode.Tag)["id"].ToString());
First time its ok, but after event click fires and loads product`s info into panel second time I try to load dataGridView by id from row (same code above) I get error:

RowNotInTableException:
Expand|Select|Wrap|Line Numbers
  1. This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row.
May 5 '11 #1
0 1203

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Rune Runnestř | last post by:
How do I focus the cursor in the input field 'numberField' when accessing this jsp-file (or html-file) ? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>...
1
by: ken.beutler | last post by:
I am getting a 404 error when trying to access an ASP page from a remote machine (via Internet Explorer). However, the asp page is processed successfully when accessing this page from the local...
3
by: Nathan Sokalski | last post by:
When I attempt to access a Microsoft Access database from my website, I recieve the following error: Server Error in '/' Application....
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.