Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 5th, 2006, 03:20 AM
Registered User
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataTable AutoincrementColumn problem

I have a Datatable containing an auto increment column.

The code I have written for this is

DataSet BillDetails = new DataSet();
DataTable dt = new DataTable("Table");
DataColumn dc = new DataColumn("bill_line_no", typeof(Int32));
dc.AutoIncrement = true;
dc.AutoIncrementSeed = 1;
dt.Columns.Add(dc);
BillDetails.Tables.Add(dt);
if (mode.Equals(Constants.ADD))
{
    OracleHelper.FillSchema(BillDetails,OracleHelper.W ASPORT_WAS,
        CommandType.StoredProcedure, get_bill_details, parms);
}
else
{
        OracleHelper.ExecuteDataset(BillDetails,OracleHelp er.WASPORT_WAS,
             CommandType.StoredProcedure, get_bill_details, parms);
}

This is working fine in the add mode where I am using FillSchema method to fill the

dataset. It is working fine even in the case of edit mode where I am using Fill method

of dataset.

I am getting the problem in the edit mode only when a record is deleted from the

datatable and then a new record is inserted into it. The sequence number generated was

rather strange.

For every new record being added, I am getting a sequence number which is equal to the

number of records in the datatable when the first time it is loaded plus the number of

records currently existing in the datatable + 1.

Can anyone help me in this regard?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with DataTable ayazhoda ASP.NET 1.x and 2.0 Application Design 1 April 8th, 2007 10:12 PM
For Loop problem with DataSet\DataTable musa BOOK: ASP.NET Website Programming Problem-Design-Solution 2 December 25th, 2003 03:11 AM
For Loop problem with DataSet\DataTable musa BOOK: Professional C#, 2nd and 3rd Editions 1 December 24th, 2003 09:46 AM
For Loop problem with DataSet\DataTable musa BOOK: Beginning ASP.NET 1.0 0 December 23rd, 2003 06:31 PM
updating db with dataAdapter/dataTable problem mm1234 ADO.NET 0 November 19th, 2003 06:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.