Dear all,

I have a file-strongly type dataset, that have two independent table inside
it.
I want to fill the two table in the dataset by one stored procedure(have two
select sql on it) how can i do

e.g.
create spname
..
SELECT * FROM table1
SELECT * FROM table2
GO

and

Dataadapter.fill(dataset.table1)
but how about table2

Re: Fill strongly type dataset from stored procedure by Cor

Cor
Wed Feb 01 00:33:44 CST 2006

Ken,

I will not garantee you that you get an answer, however the generated
Strongly Typed Dataset from version 2002/3 is completely different from
version 2005, so maybe can you tell what you use.

In fact it should at the fill be just telling the right table that you want
and nothing more.

Cor



Re: Fill strongly type dataset from stored procedure by ken

ken
Wed Feb 01 03:57:29 CST 2006

2005 vb.net

"Cor Ligthert [MVP]" wrote:

> Ken,
>
> I will not garantee you that you get an answer, however the generated
> Strongly Typed Dataset from version 2002/3 is completely different from
> version 2005, so maybe can you tell what you use.
>
> In fact it should at the fill be just telling the right table that you want
> and nothing more.
>
> Cor
>
>
>

Re: Fill strongly type dataset from stored procedure by W

W
Wed Feb 01 08:03:45 CST 2006

You can definitely do this. However if the table names in the stored procs
differ from the table names in your Typed DataSet, you'll need to specify
tableMappings (and probably column mappings if the columns don't match up).
MSN Search on tableMappings and there are many examples. HTH,

Bill
"ken" <ken@discussions.microsoft.com> wrote in message
news:83F84043-0295-401F-9FC7-C43BE0FEBB78@microsoft.com...
> Dear all,
>
> I have a file-strongly type dataset, that have two independent table
> inside
> it.
> I want to fill the two table in the dataset by one stored procedure(have
> two
> select sql on it) how can i do
>
> e.g.
> create spname
> ..
> SELECT * FROM table1
> SELECT * FROM table2
> GO
>
> and
>
> Dataadapter.fill(dataset.table1)
> but how about table2
>
>



Re: Fill strongly type dataset from stored procedure by ken

ken
Wed Feb 01 08:41:34 CST 2006

Thanks you, but not work

the stored procedures is
SELECT TABLE1.A, TABLE2.B FROM TABLE1 INNER JOIN TABLE2 ON x1=y1
SELECT SUM(TABLE1.C) AS TOTAL FROM TABLE2

THE STRONGLY TYPE dataset have two tables
one name is tblTable1, the other is tblTable2, the schema match the select
statement.

da.tablemappings.add("TABLE1", "tblTable1") '?? I think problem is here,
da.tablemappings.add("TABLE2", "tblTable2")
da.fill(ds)

Can you see the problem , please help me!















"W.G. Ryan - MVP" wrote:

> You can definitely do this. However if the table names in the stored procs
> differ from the table names in your Typed DataSet, you'll need to specify
> tableMappings (and probably column mappings if the columns don't match up).
> MSN Search on tableMappings and there are many examples. HTH,
>
> Bill
> "ken" <ken@discussions.microsoft.com> wrote in message
> news:83F84043-0295-401F-9FC7-C43BE0FEBB78@microsoft.com...
> > Dear all,
> >
> > I have a file-strongly type dataset, that have two independent table
> > inside
> > it.
> > I want to fill the two table in the dataset by one stored procedure(have
> > two
> > select sql on it) how can i do
> >
> > e.g.
> > create spname
> > ..
> > SELECT * FROM table1
> > SELECT * FROM table2
> > GO
> >
> > and
> >
> > Dataadapter.fill(dataset.table1)
> > but how about table2
> >
> >
>
>
>

Re: Fill strongly type dataset from stored procedure by W

W
Wed Feb 01 09:57:43 CST 2006

Just to make sure, fill an untyped dataset with that query and check the
table names that it uses (It will create two tables - check the table names
of those) and make sure they match.
"ken" <ken@discussions.microsoft.com> wrote in message
news:488C2934-4EF5-4F51-B6B0-500B1C55893D@microsoft.com...
> Thanks you, but not work
>
> the stored procedures is
> SELECT TABLE1.A, TABLE2.B FROM TABLE1 INNER JOIN TABLE2 ON x1=y1
> SELECT SUM(TABLE1.C) AS TOTAL FROM TABLE2
>
> THE STRONGLY TYPE dataset have two tables
> one name is tblTable1, the other is tblTable2, the schema match the select
> statement.
>
> da.tablemappings.add("TABLE1", "tblTable1") '?? I think problem is here,
> da.tablemappings.add("TABLE2", "tblTable2")
> da.fill(ds)
>
> Can you see the problem , please help me!
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> "W.G. Ryan - MVP" wrote:
>
>> You can definitely do this. However if the table names in the stored
>> procs
>> differ from the table names in your Typed DataSet, you'll need to specify
>> tableMappings (and probably column mappings if the columns don't match
>> up).
>> MSN Search on tableMappings and there are many examples. HTH,
>>
>> Bill
>> "ken" <ken@discussions.microsoft.com> wrote in message
>> news:83F84043-0295-401F-9FC7-C43BE0FEBB78@microsoft.com...
>> > Dear all,
>> >
>> > I have a file-strongly type dataset, that have two independent table
>> > inside
>> > it.
>> > I want to fill the two table in the dataset by one stored
>> > procedure(have
>> > two
>> > select sql on it) how can i do
>> >
>> > e.g.
>> > create spname
>> > ..
>> > SELECT * FROM table1
>> > SELECT * FROM table2
>> > GO
>> >
>> > and
>> >
>> > Dataadapter.fill(dataset.table1)
>> > but how about table2
>> >
>> >
>>
>>
>>



Re: Fill strongly type dataset from stored procedure by ken

ken
Thu Feb 02 03:11:27 CST 2006

Thanks

the table name-
Table , Table1


but why the table name is liked that?










"W.G. Ryan - MVP" wrote:

> Just to make sure, fill an untyped dataset with that query and check the
> table names that it uses (It will create two tables - check the table names
> of those) and make sure they match.
> "ken" <ken@discussions.microsoft.com> wrote in message
> news:488C2934-4EF5-4F51-B6B0-500B1C55893D@microsoft.com...
> > Thanks you, but not work
> >
> > the stored procedures is
> > SELECT TABLE1.A, TABLE2.B FROM TABLE1 INNER JOIN TABLE2 ON x1=y1
> > SELECT SUM(TABLE1.C) AS TOTAL FROM TABLE2
> >
> > THE STRONGLY TYPE dataset have two tables
> > one name is tblTable1, the other is tblTable2, the schema match the select
> > statement.
> >
> > da.tablemappings.add("TABLE1", "tblTable1") '?? I think problem is here,
> > da.tablemappings.add("TABLE2", "tblTable2")
> > da.fill(ds)
> >
> > Can you see the problem , please help me!
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > "W.G. Ryan - MVP" wrote:
> >
> >> You can definitely do this. However if the table names in the stored
> >> procs
> >> differ from the table names in your Typed DataSet, you'll need to specify
> >> tableMappings (and probably column mappings if the columns don't match
> >> up).
> >> MSN Search on tableMappings and there are many examples. HTH,
> >>
> >> Bill
> >> "ken" <ken@discussions.microsoft.com> wrote in message
> >> news:83F84043-0295-401F-9FC7-C43BE0FEBB78@microsoft.com...
> >> > Dear all,
> >> >
> >> > I have a file-strongly type dataset, that have two independent table
> >> > inside
> >> > it.
> >> > I want to fill the two table in the dataset by one stored
> >> > procedure(have
> >> > two
> >> > select sql on it) how can i do
> >> >
> >> > e.g.
> >> > create spname
> >> > ..
> >> > SELECT * FROM table1
> >> > SELECT * FROM table2
> >> > GO
> >> >
> >> > and
> >> >
> >> > Dataadapter.fill(dataset.table1)
> >> > but how about table2
> >> >
> >> >
> >>
> >>
> >>
>
>
>

Re: Fill strongly type dataset from stored procedure by W

W
Thu Feb 02 07:20:25 CST 2006

Ken - change your table names to match and see if that doesn't fix it.
"ken" <ken@discussions.microsoft.com> wrote in message
news:FE9372E2-92EE-4713-B92D-B6567B82E4BA@microsoft.com...
> Thanks
>
> the table name-
> Table , Table1
>
>
> but why the table name is liked that?
>
>
>
>
>
>
>
>
>
>
> "W.G. Ryan - MVP" wrote:
>
>> Just to make sure, fill an untyped dataset with that query and check the
>> table names that it uses (It will create two tables - check the table
>> names
>> of those) and make sure they match.
>> "ken" <ken@discussions.microsoft.com> wrote in message
>> news:488C2934-4EF5-4F51-B6B0-500B1C55893D@microsoft.com...
>> > Thanks you, but not work
>> >
>> > the stored procedures is
>> > SELECT TABLE1.A, TABLE2.B FROM TABLE1 INNER JOIN TABLE2 ON x1=y1
>> > SELECT SUM(TABLE1.C) AS TOTAL FROM TABLE2
>> >
>> > THE STRONGLY TYPE dataset have two tables
>> > one name is tblTable1, the other is tblTable2, the schema match the
>> > select
>> > statement.
>> >
>> > da.tablemappings.add("TABLE1", "tblTable1") '?? I think problem is
>> > here,
>> > da.tablemappings.add("TABLE2", "tblTable2")
>> > da.fill(ds)
>> >
>> > Can you see the problem , please help me!
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > "W.G. Ryan - MVP" wrote:
>> >
>> >> You can definitely do this. However if the table names in the stored
>> >> procs
>> >> differ from the table names in your Typed DataSet, you'll need to
>> >> specify
>> >> tableMappings (and probably column mappings if the columns don't match
>> >> up).
>> >> MSN Search on tableMappings and there are many examples. HTH,
>> >>
>> >> Bill
>> >> "ken" <ken@discussions.microsoft.com> wrote in message
>> >> news:83F84043-0295-401F-9FC7-C43BE0FEBB78@microsoft.com...
>> >> > Dear all,
>> >> >
>> >> > I have a file-strongly type dataset, that have two independent table
>> >> > inside
>> >> > it.
>> >> > I want to fill the two table in the dataset by one stored
>> >> > procedure(have
>> >> > two
>> >> > select sql on it) how can i do
>> >> >
>> >> > e.g.
>> >> > create spname
>> >> > ..
>> >> > SELECT * FROM table1
>> >> > SELECT * FROM table2
>> >> > GO
>> >> >
>> >> > and
>> >> >
>> >> > Dataadapter.fill(dataset.table1)
>> >> > but how about table2
>> >> >
>> >> >
>> >>
>> >>
>> >>
>>
>>
>>