How Many DbCall for dataSet?

Results 1 to 2 of 2

Thread: How Many DbCall for dataSet?

  1. #1
    Join Date
    Dec 1969

    Default How Many DbCall for dataSet?

    This may be a dumb question, but here goes..<BR><BR>If I use a SqlAdapter to populate a dataSet with data from multiple (unrelated) tables like this...<BR><BR>Dim myData As New DataSet<BR>Dim myAdapter As New SqlDataAdapter<BR> myAdapter = New SqlDataAdapter(strSqlOne, objConn)<BR> myAdapter.Fill(myData, "myTableOne")<BR> myAdapter = New SqlDataAdapter(strSqlTwo, objConn)<BR> myAdapter.Fill(myData, "myTableTwo")<BR> myAdapter = New SqlDataAdapter(strSqlThree, objConn)<BR> myAdapter.Fill(myData, "myTableThree")<BR>&#039;where the each sql is a Select Statement and objConn is open...<BR> objConn.Close<BR> objConn = Nothing<BR> myAdapter = Nothing<BR><BR>Is the web-server making three seperate database "calls" or is it going once to the dataBase, getting all the info at once, then returning the dataSet?<BR><BR>Thanks in advance<BR>David<BR>

  2. #2
    Join Date
    Dec 1969

    Default 3 calls i believe

    yes, that would be 3 calls...<BR><BR>if you want to make it one call, you could write a PROC that has all three SQL statements in it and the PROC will return three "recordsets" (for lack of a better term) and the single call from the code will "fill" all three tables

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts