0

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

4
  • Please post the code you have written so far. People generally do not like to just write your code for you. Commented Mar 17, 2010 at 10:57
  • I just write code for Normal pivot table. I did not any code for this Pivot table. Commented Mar 17, 2010 at 11:06
  • Do you already have it in a "DataTable" object? Is the data coming down from some SQL database... Where is its origin? Commented Mar 17, 2010 at 11:10
  • BatchId-1,BatchName-1 are Sql Database table columns Commented Mar 17, 2010 at 11:19

3 Answers 3

4

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).

Sign up to request clarification or add additional context in comments.

Comments

0

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

2 Comments

Can you please tell me those free alternatives?
They're just hypothetical free alternatives, I actually don't know any of them...
0

Write a stored procedure, or a LINQ statement.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.