Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Here I want to insert more then one records using only single id like

order id-1
item amount total
rin 5 29
lux 10
wheel 2
excel 12

Please give code or query for such type of insert records.
Posted
Updated 16-Sep-10 21:35pm
v2
Comments
Hiren solanki 17-Sep-10 2:14am    
Can you please clarify your question again ? i am not getting what actually you want to ask
nagendrathecoder 17-Sep-10 2:22am    
Here, are all these, "order id","item","amount" & "total" are columns of the same table? Or "Order id" is in different table?
Dalek Dave 17-Sep-10 3:35am    
Minor Edit for clarity.

After looking at your last few questions, its clear that you have not learned concepts of ADO.Net.
You are asking some very basic questions here and this will continue till you don't learn ADO.Net.
I suggest you to first buy a book and learn all concepts of ADO.Net.
It will definitely help you.
 
Share this answer
 
Comments
Dalek Dave 17-Sep-10 3:36am    
Harsh but fair!
Use one-to-many relationship. Create OrderTable and store the orderdetails such as id and date etc. Create OrderItemTable to store the Order Item details , here you can refer the order id from the orderTable to relate each item with a particular order.

Hope this will help you :)
 
Share this answer
 
uses of unique key is to avoid duplicate entries and it enforce entity integrity as the primary key constraints, more than one record with single unique key is not possible.
 
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