开发者

How to create Pivot table using C#?

开发者 https://www.devze.com 2022-12-23 00:13 出处:网络
I need to create a pivot like this BatchID-1BatchID-2 BachName-1BachName-2 Chemical-10.1null Chemical-2null开发者_开发问答0.3

I need to create a pivot like this

                     BatchID-1        BatchID-2
                     BachName-1       BachName-2

Chemical-1             0.1                null
Chemical-2             null            开发者_开发问答    0.3

BatchID,BatchName are columns of the Sql Server Table. Here i need to display the value of specific chemical if Specific BatchID and BatchName

Can any one please help me.

Thank You


I suggest leaning a bit of SQL, a bit of C# and a bit about pivot table. Then write some code. Preferably, make it compile.

Once you know all these things, you'll probably be able to ask a more precise question, such as "Using the Xxx Pivot control, I try to read data from SQL server using this SQL query and try to populate the data, but I encounter this specific issue..."

At that point, stackoverflow will probably be helpful in answering your question. Until then, I don't think anyone is going to give you the code you require, as writing code is probably what you should be doing yourself to learn (if student), grow (if amateur) or get paid (professional).


Use a control such as XtraPivotGrid (DevExpress), or some free alternative


Write a stored procedure, or a LINQ statement.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号