Filling a dataset using one stored procedure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rami

    Filling a dataset using one stored procedure

    Dear all,

    i would like to ask if it possible to fill a dataset using one stored
    procedure,

    for example:

    we have two tables ( emp ) and ( Dept )

    can i use the following stored procedure to fill the dataset

    < SQL CODE >
    Create procedure sp_emp_and_Dept
    AS
    begin

    select * from emp

    select * from dept
    end



    Thanks,
    Rami
  • Mohamed Harris via DotNetMonster.com

    #2
    Re: Filling a dataset using one stored procedure

    Hi,

    You better to use the following query with in your SP

    select e.field1,e.fiel d2,d.field1,d.f ield2,d.field3 from emp e,dept d <where>



    Harris

    --
    Message posted via http://www.dotnetmonster.com

    Comment

    • Rami

      #3
      Re: Filling a dataset using one stored procedure

      Thanks Mohammed but the method that i was looking for is mapping tables
      comming from the multi select statements

      the mapping will be as following:

      <Adapter>.Table Mapping.Add ( "Table", "emp" )
      <Adapter>.Table Mapping.Add ( "Table1", "Dept" )


      Thanks
      Mohammed,

      "Mohamed Harris via DotNetMonster.c om" wrote:
      [color=blue]
      > Hi,
      >
      > You better to use the following query with in your SP
      >
      > select e.field1,e.fiel d2,d.field1,d.f ield2,d.field3 from emp e,dept d <where>
      >
      >
      >
      > Harris
      >
      > --
      > Message posted via http://www.dotnetmonster.com
      >[/color]

      Comment

      Working...