Cannot access the added row using Table.Select method

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: RaviKiran (RaviKiran_at_discussions.microsoft.com)
Date: 10/02/04


Date: Sat, 2 Oct 2004 00:43:02 -0700

Hi All,
I am working on a windows application. I am facing a problem in accessing
the added row of a table using Table.Select method.
Following explains the problem
Following is my table

Table: BatchData
PrimaryKey : BatchId INT IDENTITY (AutoIndex Column)
I am accesing the table's data in a dataset with FillSchema and Fill ,and I
made the primarykey.readonly = false

DS.Tables("BatchData").PrimaryKeyColumn.Readonly = false

I am binding the part of the table to a DataGrid (Based on Selectction
criterion). I am adding the rows to the grid, which inturn adding rows to my
data table. I am able to access the added rows. Now I want to change the
primaryKey value of the added rows.I am able to assign the value to the
primary Key. When I am trying to access the row with the newly assigned
value, I am not able to retrieve the row.

Following are the initial values

DataRow dr = DS.Tables("BatchData").GetChanges(RowState.Added)(0)
dr("PrimaryKey") is 850 now -- Initial Value
I want to assign value - 10001 to the primary key
DS.Tables("BatchData").Select("BatchId = 850")(0)("BatchId") = 10001 -- New
Value

I am able to assign the value, Now I am trying to retrieve the row like the
following

DS.Tables("BatchData").Select("BatchId = 10001")
Here I am facing the problem, I am not able to retrieve the row data if I
use the newly assigned value..

Please help me in solving this problem..

Regards,
RaviKiran



Relevant Pages

  • Re: Cannot access the added row using Table.Select method
    ... quick watch window, it is showing me the latest value only, But If I ... Primary Key of my table is an auto indexed column in my table. ... I am not able to retrieve the row. ... >> Here I am facing the problem, I am not able to retrieve the row data if I ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Cannot access the added row using Table.Select method
    ... I think you may have a problem with assignment. ... > primary Key. ... I am not able to retrieve the row. ... > Here I am facing the problem, I am not able to retrieve the row data if I ...
    (microsoft.public.dotnet.framework.adonet)
  • ASP.net DataGrid with LinkButton
    ... That primary key will be either a textbox or it can be a ... this primary key value into a standard select statement to retrieve uploaded ... another table of the database along with the previously viewed file. ... suspect this is a simple download from one table to another in the database. ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • Re: DBI & primary keys
    ... > retrieve the unique primary key that's created automatically by the db as ... > to want to know the primary key for a newly inserted record, ... "You can retrieve the most recent AUTO_INCREMENT value with the LAST_INSERT_IDSQL function" ...
    (comp.lang.perl.misc)
  • Re: URGENT:Unable to determine IP address from host name problem on XP
    ... This is some sort of joke? ... I m facing the following problem and I can not fixe cause everything ... While trying to retrieve the URL: ...
    (microsoft.public.windowsxp.general)