Results 1 to 5 of 5

Thread: problem populating dataset [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    problem populating dataset [RESOLVED]

    I have the following code:

    Code:
            Dim NumUploads As Integer
            Dim myConnString As String = 'My Conn String
            Dim myConnection As New SqlConnection(myConnString)
            myConnection.Open()
    
            Dim ds As New DataSet
            Dim myAdapter As New SqlDataAdapter("select * from uploads where uploadedby = '" + Membership.GetUser(UserName, True).ProviderUserKey.ToString + "'", myConnection)
            myAdapter.Fill(ds)
    
            NumUploads = ds.Tables(0).Rows.Count
    
            myConnection.Close()
            Return NumUploads
    I know that the connection and the sql query are correct and working, the problem is that when I put a breakpoint at NumUploads = ds.Tables(0).Rows.Count, it returns a 0 every time. Why? I know that the sql query should (and does in sql express manager) return 3 records.

    Thanks,

    Squirrelly1
    Last edited by squirrelly1; Feb 12th, 2008 at 04:30 PM.
    Now happily married and still crankin' away at the keyboard. Life is grand for a coder, no?

Posting Permissions

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



Click Here to Expand Forum to Full Width