Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql syntax - Sql Server - Visual Studio 2005

Status
Not open for further replies.

mr2tho

Programmer
Mar 30, 2006
25
US
Hi,
I am working on a data entry in Visual Studio 2005 and SQL Server 2005. The Data Entry form is going to be crosstab. The Column and row of the crosstab table is in an list table (ltbl), so I am trying to make it dynamic.

I made a stored procudure that returns crosstab according to the number of records in ltblColumn and ltblRow all empty in beginning. I put the return of that stored procedure to a datatable, made a datagrid. Now the user fills the datagrid, I save all the info datatable. And I am stuck here.

If I save the data to a worktable in database, i would probably use UNpivot property of SQL Server 2005 and add the records to my normal (not crossed tabbed) table. But because the ltblRow and ltblColumn values changes, I don't want to give permission to create a table everytime they press Save, and that would be slow, too. And also changing the value may require more coding because it's different than just adding a record.

Do you have any suggestions?

If any of you know, is it possible in Visual Studio 2005 to use Unpivot of sql server 2005 to a datatable and save the result to another datatable inside Visual Studio. Do you think that would work?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top