Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate AutoNumber In A Table Updated Via A DataGrid

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
0
0
US


I have a widows forms project in which I have created a datasource for an as400/iseries table and dragged the table to the form as a datagrid.
This creates the simple bound datagrid that allows me to add, edit and delete rows.
The problem is that the primary key on the table is an aoutonumber field.
On the database a new unique value is generated each time a row is added.
But I don't know how to get the same behaviour out of a datagrid iwritten in visual studio.

I tried setting the default value for the column to Null in the schema for the dataset but the database won't accept a null value.
I tried setting the autoincrement property to True but this seems to use the dataset seed properties rather than the database
number next available.

Bet this is something simple but it is escaping me at the moment.




Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Basically I am a dope.

Once I set the AutoIncrement property for the field to true and the Seed values it worked fine.





Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top