Results 1 to 6 of 6

Thread: DataGrid view question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2004
    Location
    STL
    Posts
    182

    DataGrid view question

    Hey all, just wanted to say thanks for everyone's help on here...

    So, I have a DataGrid that is being populated by a DataSet, and when it runs, what pops up in the left-upper corner of the dataGrid area is a grey box, with a arrow and + sign. When you click the + sign it opens another tab with "Hours" which I specified in my code posted below....

    Once you hit Hours it brings up the DataSet with all my fields, etc... why is it not just bring that up in the first place???



    VB Code:
    1. Dim DsHours1 As New DataSet
    2.         Dim cmdTime As New SqlCommand
    3.  
    4. Dim strTimeByDate As String = "SELECT * FROM Hours"
    5.  
    6. conbilling.Open()
    7.  
    8.         cmdTime.Connection = conbilling
    9.         cmdTime.CommandText = strTimeByDate
    10.  
    11.         Dim daHours As New SqlDataAdapter(cmdTime)
    12.         daHours.Fill(DsHours1, "Hours")
    13.        grdHoursData.DataSource = DsHours1
    14.  
    15.         conbilling.Close()

  2. #2
    Addicted Member
    Join Date
    Sep 2004
    Location
    Brooklyn
    Posts
    147
    Hmmmmmmm try adding a line as follows:

    grdHoursData.DataSource = DsHours1
    grdHoursData.Refresh()

  3. #3
    Junior Member
    Join Date
    Sep 2004
    Location
    India
    Posts
    16
    Hi,

    I think this will work....just try it..........


    grdHoursData.DataSource = DsHours1

    grdHoursData.Datamember = "Hours"

    Regards,
    Ritesh

  4. #4
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416
    VB Code:
    1. Dim daHours As New SqlDataAdapter(cmdTime)
    2.         daHours.Fill(DsHours1, "Hours")
    3.        [b]grdHoursData.DataSource = DsHours1.Tables("Hours")[/b]
    4.  
    5.         conbilling.Close()

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173
    Someone once told me that this was probably the most frequently asked question on the forums.

  6. #6
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416
    Originally posted by mendhak
    Someone once told me that this was probably the most frequently asked question on the forums.

    yup i also ask this one before..

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