How to return DataSet

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

    How to return DataSet

    Hello:

    I'm creating an ASP.Net application. I need to run a method that would
    return a DataSet. I'm new to C#, so I have a problem with it.

    In VB.Net I just used to write a function like this:

    Public Function GetOrders(ByVal sSQL As String) As DataSet

    In C# when I try to write something like this:

    public DataSet CreateDataset(s tring sSQL)
    {
    }

    I get an error:
    "D:\C#_Projects \connect_class\ connect_class\c lConnect.cs(16) : The type or
    namespace name 'DataSet' could not be found (are you missing a using
    directive or an assembly reference?)"

    How would I do this?

    Thank you very much in advance,
    --
    Peter Afonin


  • Alvin Bruney

    #2
    Re: How to return DataSet

    you need the system.data namespace in your using section at the top of the
    file

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "Peter Afonin" <pafo@specialty pulltabs.com> wrote in message
    news:uSOCCy#pDH A.2012@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Hello:
    >
    > I'm creating an ASP.Net application. I need to run a method that would
    > return a DataSet. I'm new to C#, so I have a problem with it.
    >
    > In VB.Net I just used to write a function like this:
    >
    > Public Function GetOrders(ByVal sSQL As String) As DataSet
    >
    > In C# when I try to write something like this:
    >
    > public DataSet CreateDataset(s tring sSQL)
    > {
    > }
    >
    > I get an error:
    > "D:\C#_Projects \connect_class\ connect_class\c lConnect.cs(16) : The type or
    > namespace name 'DataSet' could not be found (are you missing a using
    > directive or an assembly reference?)"
    >
    > How would I do this?
    >
    > Thank you very much in advance,
    > --
    > Peter Afonin
    >
    >[/color]


    Comment

    • Peter Afonin

      #3
      Re: How to return DataSet

      Thank you, Alvin.

      "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
      message news:OrV9w6$pDH A.2488@TK2MSFTN GP12.phx.gbl...[color=blue]
      > you need the system.data namespace in your using section at the top of the
      > file
      >
      > --
      >
      >
      > -----------
      > Got TidBits?
      > Get it here: www.networkip.net/tidbits
      > "Peter Afonin" <pafo@specialty pulltabs.com> wrote in message
      > news:uSOCCy#pDH A.2012@TK2MSFTN GP12.phx.gbl...[color=green]
      > > Hello:
      > >
      > > I'm creating an ASP.Net application. I need to run a method that would
      > > return a DataSet. I'm new to C#, so I have a problem with it.
      > >
      > > In VB.Net I just used to write a function like this:
      > >
      > > Public Function GetOrders(ByVal sSQL As String) As DataSet
      > >
      > > In C# when I try to write something like this:
      > >
      > > public DataSet CreateDataset(s tring sSQL)
      > > {
      > > }
      > >
      > > I get an error:
      > > "D:\C#_Projects \connect_class\ connect_class\c lConnect.cs(16) : The type[/color][/color]
      or[color=blue][color=green]
      > > namespace name 'DataSet' could not be found (are you missing a using
      > > directive or an assembly reference?)"
      > >
      > > How would I do this?
      > >
      > > Thank you very much in advance,
      > > --
      > > Peter Afonin
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...