how to add
-
Dear All, I used Ms access as a database and the table contains 3 columns as Id, Name and email. I set the Id as a autonumber as well as the primary key. my problem is, how to add code in asp.net form to make the Id get added automatically in database. My program works well if i give unique value to id but i don't want to show id on the form. cud anyone help me? also i tried in another way --- designed a query in database and sorted the id column in descending order. In asp.net i took the query's first record's id and add by one. set it as a new value. it works but the problem is, for ex: if the last record's id is 4 and when i add by one 1, I get the new id as 41 instead of 5. cud u help me to sort out this problem?
-
Dear All, I used Ms access as a database and the table contains 3 columns as Id, Name and email. I set the Id as a autonumber as well as the primary key. my problem is, how to add code in asp.net form to make the Id get added automatically in database. My program works well if i give unique value to id but i don't want to show id on the form. cud anyone help me? also i tried in another way --- designed a query in database and sorted the id column in descending order. In asp.net i took the query's first record's id and add by one. set it as a new value. it works but the problem is, for ex: if the last record's id is 4 and when i add by one 1, I get the new id as 41 instead of 5. cud u help me to sort out this problem?
-
Dear All, I used Ms access as a database and the table contains 3 columns as Id, Name and email. I set the Id as a autonumber as well as the primary key. my problem is, how to add code in asp.net form to make the Id get added automatically in database. My program works well if i give unique value to id but i don't want to show id on the form. cud anyone help me? also i tried in another way --- designed a query in database and sorted the id column in descending order. In asp.net i took the query's first record's id and add by one. set it as a new value. it works but the problem is, for ex: if the last record's id is 4 and when i add by one 1, I get the new id as 41 instead of 5. cud u help me to sort out this problem?
Pratheepa wrote:
cud u help me to sort out this problem?
Your basic issue, apart from not being able to spell, is that you appear to be adding to the number as a string. If you convert it to a number, you can add 1 to it. Not sure if that is the best option. Most people have databases with ids, which they store with their data, but don't show to the user.
Christian Graus Driven to the arms of OSX by Vista. Please read this[^] if you don't like the answer I gave to your question. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.