Click here to Skip to main content
15,905,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi all,

Please help, my problem is,
when i am inserting new record into a sql table from my web page data inserted properly but when i check my related sql table row is inserted with proper data. but sequence of row is wrong. for example..
i am inserted some records in my sql table like as follows:
ID Name
1 dinesh
2 rakesh
3 rajesh
suppose i am inserting one more record then it will show like as below:
1 dinesh
2 rakesh
4 mukesh
3 rajesh
ID is primary key in table then why it show like.


Thanks in Adavance.......
Posted
Comments
Mr. Mahesh Patel 14-Sep-12 8:05am    
Please provide your code snippets and table structure.
[no name] 14-Sep-12 10:38am    
What difference does it make?

When you retrieve the data from the table, make sure that you added an Order By clause in your query/view! E.g.
SQL
SELECT *
FROM MYTABLE
ORDER BY ID ASC
 
Share this answer
 
check how you have defined the schema...
 
Share this answer
 
use ORDER BY clause

example;


SQL
SELECT supplier_city
FROM suppliers
WHERE supplier_name = 'IBM'
ORDER BY supplier_city;
 
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