Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Dataadapter

Dataadapter

Scheduled Pinned Locked Moved ASP.NET
database
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nkiran
    wrote on last edited by
    #1

    Hi all Can i retrieve selected tables from the database using one adapter,command object without going for a storedprocedure.I dont want to retreive the entire tables in to datasource....if any one finds solution pls email me .;) With Many Thanks kiran

    V 1 Reply Last reply
    0
    • N nkiran

      Hi all Can i retrieve selected tables from the database using one adapter,command object without going for a storedprocedure.I dont want to retreive the entire tables in to datasource....if any one finds solution pls email me .;) With Many Thanks kiran

      V Offline
      V Offline
      VenkatFor NET
      wrote on last edited by
      #2

      Yes, we can give Select criteira when filling DataSet using DataAdapter. In fact, we dont even need a Command object. We can just give a "SELECT String" and a Connection which need not be open but initialised. DataAdapter will open the Connection and fill the dataset using that connection and immediately closes the Connection, if the Connection was not opened earlier. Here is a simple code ( plz check for the syntax ) Dim cn as SqlConnection = new SqlConnection ( "Connection String") Dim da as SqlDataAdapter = new SqlDataAdapter( "Select * from Table", cn ) da.Fill(ds) Bhaskara

      N 1 Reply Last reply
      0
      • V VenkatFor NET

        Yes, we can give Select criteira when filling DataSet using DataAdapter. In fact, we dont even need a Command object. We can just give a "SELECT String" and a Connection which need not be open but initialised. DataAdapter will open the Connection and fill the dataset using that connection and immediately closes the Connection, if the Connection was not opened earlier. Here is a simple code ( plz check for the syntax ) Dim cn as SqlConnection = new SqlConnection ( "Connection String") Dim da as SqlDataAdapter = new SqlDataAdapter( "Select * from Table", cn ) da.Fill(ds) Bhaskara

        N Offline
        N Offline
        nkiran
        wrote on last edited by
        #3

        Hi Thanks for your response.......but wen u specify datasource in ur connection string like pubs u get the entire tables and also we want only selected tables like employer,customers etc with only one dataadapter object. I hope u understand my problem..regarding the performance. kiran With Many Thanks kiran

        V 1 Reply Last reply
        0
        • N nkiran

          Hi Thanks for your response.......but wen u specify datasource in ur connection string like pubs u get the entire tables and also we want only selected tables like employer,customers etc with only one dataadapter object. I hope u understand my problem..regarding the performance. kiran With Many Thanks kiran

          V Offline
          V Offline
          VenkatFor NET
          wrote on last edited by
          #4

          try this da.selectcommand = "select * from employer; select * from customers" and fill the dataset Bhaskara

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups