Click here to Skip to main content
15,921,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A Gridview has 8 columns like material,contractrate,wtFactor,JanPrice,FebPrice,MarPrice,AVGPrice

Save into database like
material contractrate wtFactor Price
M1 R1 W1 Jan1Price
M1 R1 W1 Feb1Price
M1 R1 W1 Mar1Price
M1 R1 W1 AVG1Price
M2 R2 W2 Jan2Price
M2 R2 W2 Feb2Price
M2 R2 W2 Mar2Price
M2 R2 W2 AVG2Price
Here Gridview Column data like JanPrice,FebPrice,MarPrice,AVGPrice will be save one
Posted
Comments
george4986 3-Nov-14 1:14am    
the table structure is bad,U can't distinguish the price of material between months while reading from this table structure.

1 solution

You can use the pivot.

Below reference may help you.

Simple Way To Use Pivot In SQL Query[^]
 
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