Hi all,
How do I customize table names returned from the stored procedure?
For example, I have a stored procedure that is something like this:
SELECT * FROM Employee
SELECT * FROM Employer
SELECT * FROM HealthInsurance
This SP returns multiple tables to the VB.NET application. Now, the names of
the tables retuned in the dataset are: Table, Table1, and Table2. Is there a
way to customize those 3 names so the Table is "Employee", Table1 is
"Employer", Table2 is "HealthInsurance"?
I would then get the Employee data by calling:
ds.Tables("Employee")
instead of:
ds.Tables("Table")
Thanks for your time
Goran Djuranovic
hi Goran,
Goran Djuranovic wrote:
> Hi all,
> How do I customize table names returned from the stored procedure?
> For example, I have a stored procedure that is something like this:
> SELECT * FROM Employee
> SELECT * FROM Employer
> SELECT * FROM HealthInsurance
> This SP returns multiple tables to the VB.NET application. Now, the
> names of the tables retuned in the dataset are: Table, Table1, and
> Table2. Is there a way to customize those 3 names so the Table is
> "Employee", Table1 is "Employer", Table2 is "HealthInsurance"?
> I would then get the Employee data by calling:
> ds.Tables("Employee")
> instead of:
> ds.Tables("Table")
you have to customize the in memory dataset provided by ADO.Net client side,
naming your datatable accordingly to your needs as "TableX" is the default
provided by ADO.Net when no personal provided value is available, so the
TableMapping method come to hand like
Dim da As New OleDbDataAdapter(strSQL, strConn)
da.TableMappings.Add("Tabl1e", "Customers")
Dim ds As New DataSet()
da.Fill(ds)
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
Showing posts with label returned. Show all posts
Showing posts with label returned. Show all posts
Wednesday, March 28, 2012
Sunday, February 19, 2012
How to build a table which holds varying numbers of fields?
I'm using a stored procedure with multiple parameters, and depending on
the parameters offered, tables with varying fields are returned.
How can I create a table in the layout window which will accomadate
these variations?
Thanks!Only matrixes have dynamic fields... however
for list or table, create the list or table with ALL of the fields, then
conditionally hide/show the fields at run time using the visibility
attribute..
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"Balding by the handful" wrote:
> I'm using a stored procedure with multiple parameters, and depending on
> the parameters offered, tables with varying fields are returned.
> How can I create a table in the layout window which will accomadate
> these variations?
> Thanks!
>
the parameters offered, tables with varying fields are returned.
How can I create a table in the layout window which will accomadate
these variations?
Thanks!Only matrixes have dynamic fields... however
for list or table, create the list or table with ALL of the fields, then
conditionally hide/show the fields at run time using the visibility
attribute..
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"Balding by the handful" wrote:
> I'm using a stored procedure with multiple parameters, and depending on
> the parameters offered, tables with varying fields are returned.
> How can I create a table in the layout window which will accomadate
> these variations?
> Thanks!
>
Subscribe to:
Posts (Atom)