Hi,
I need to display a dataset where everything is dynamic.
e.g. I have a table with columns "Code", "Descriptio n" and "Inspected" and
another table with columns "UserCode", "Name", "PostCode" and "Town" etc
And I need to dislay data like this from a single db proc with parameters:-
(TableName, ColumnName, ColumnValue)
Procedure called with these parameters (CodeTable, Code, TD001) would return
a dataset like this:-
----------------------------------
|Code | TD001
|Description| Printer
|Inspected | Y
---------------------------------
Not
----------------------------------
|TD001
|Printer
|Y
---------------------------------
Procedure called with these parameters (UserTable, UserCode, CP1) would
return a dataset like:-
---------------------------------
|UserCode | CP1
|Name | Charles
|PostCode | 2000
|Town | Sydney
---------------------------------
Not
---------------------------------
|CP1
| Charles
| 2000
| Sydney
---------------------------------
Any ideas how I would code the database proc, I did consider using XML but
not sure.
Thanks
AJP
I need to display a dataset where everything is dynamic.
e.g. I have a table with columns "Code", "Descriptio n" and "Inspected" and
another table with columns "UserCode", "Name", "PostCode" and "Town" etc
And I need to dislay data like this from a single db proc with parameters:-
(TableName, ColumnName, ColumnValue)
Procedure called with these parameters (CodeTable, Code, TD001) would return
a dataset like this:-
----------------------------------
|Code | TD001
|Description| Printer
|Inspected | Y
---------------------------------
Not
----------------------------------
|TD001
|Printer
|Y
---------------------------------
Procedure called with these parameters (UserTable, UserCode, CP1) would
return a dataset like:-
---------------------------------
|UserCode | CP1
|Name | Charles
|PostCode | 2000
|Town | Sydney
---------------------------------
Not
---------------------------------
|CP1
| Charles
| 2000
| Sydney
---------------------------------
Any ideas how I would code the database proc, I did consider using XML but
not sure.
Thanks
AJP
Comment