What I wish to do is, take that queried data, and perform manipulation on it, such that I end up with multiple .NET CASE statements: possibly stuffing the results in a table, in a single row per result.
e.g. using the above row data from Excel, I would like to end up with:
Case 111222 MsgBox("company is:" A COMPANY NAME + Environment.NewLine + Col 1: 20 Col 2: 15 Col 3: 10)
Example of my desired output:
Thoughts?
Rich Capture.PNG
.NET Programming* SSMSMicrosoft SQL Server
Last Comment
Butler Bros
8/22/2022 - Mon
Dustin Saunders
I'm still not exactly clear on your objective. Can you give me an example of how a user would interact with your process and what results would be expected?
Are you trying to query Excel data in .NET and use that in a form? Is there a reason why you have the Excel data in an .xlsx and not in a database itself?
Butler Bros
ASKER
see corrections in my OP.
Sorry for the confusion
Dustin Saunders
What I mean is, what's the purpose of the case statements? Do you want to generate 900 different case statements for your code in SSMS? Are you putting these case statements in a .NET app or in Excel vb code..?
You have a table structure... why not use that for your select results rather than rows and rows of case statements? What happens when a row is added? You have to re-run SSMS and then paste in the new case statements?
Are you trying to query Excel data in .NET and use that in a form? Is there a reason why you have the Excel data in an .xlsx and not in a database itself?