-
Sep 17th, 2004, 11:49 AM
#1
Thread Starter
Addicted Member
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:
Dim DsHours1 As New DataSet
Dim cmdTime As New SqlCommand
Dim strTimeByDate As String = "SELECT * FROM Hours"
conbilling.Open()
cmdTime.Connection = conbilling
cmdTime.CommandText = strTimeByDate
Dim daHours As New SqlDataAdapter(cmdTime)
daHours.Fill(DsHours1, "Hours")
grdHoursData.DataSource = DsHours1
conbilling.Close()
-
Sep 17th, 2004, 12:18 PM
#2
Addicted Member
Hmmmmmmm try adding a line as follows:
grdHoursData.DataSource = DsHours1
grdHoursData.Refresh()
-
Sep 17th, 2004, 12:39 PM
#3
Junior Member
Hi,
I think this will work....just try it..........
grdHoursData.DataSource = DsHours1
grdHoursData.Datamember = "Hours"
Regards,
Ritesh
-
Sep 17th, 2004, 08:53 PM
#4
VB Code:
Dim daHours As New SqlDataAdapter(cmdTime)
daHours.Fill(DsHours1, "Hours")
[b]grdHoursData.DataSource = DsHours1.Tables("Hours")[/b]
conbilling.Close()
-
Sep 19th, 2004, 11:53 PM
#5
Someone once told me that this was probably the most frequently asked question on the forums.
-
Sep 20th, 2004, 03:59 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|