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
> >> >
> >> >
> >>
> >>
> >>
>
>
>