Click here to Skip to main content
15,921,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
each time when i run a program in vb.net the column should start with 1 and then it should be auto generated in the table of my sql.
suppose i have a table table1 with fields tab1,tab2,tab3
tab1 tab2 tab3
1      ggg  jjj
2      jjh   kjjk

when i run again the vb.net program all the column to be deleted and the auto generate column tab1 should start with 1.
i cant coz
tab1   tab2   tab3
3      ggg     jjj
4       jjh     kjjk

plz help it should start with
1    ggg     jjj
2    jjj     kjjk

plz help.......................
Posted
Updated 7-Jan-12 1:04am
v2

I think it is bad database design.

if tab1 is a auto generated column then it should require another column to insert data (current tab1 data)

Otherwise data inconsistency occurred.

Thanks.
 
Share this answer
 
v4
Comments
taher ahmed choudhury 7-Jan-12 7:30am    
no i am loading in the database successful but the colum which is autogenerated is starting with the last index once after deleting all the columns of the tables through code
You can use TRUNCATE TABLE to delete all the rows in the table and reset the auto increment value: http://dev.mysql.com/doc/refman/5.5/en/truncate-table.html[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900