rfgraham
asked on
Text not visible in DataGridView1 VB.Net 2005
The following code collects data from a SQL DB and populates a DataGridView, the only problem is I can't see the data in the DataGridView. If I select a cell then I can see whats in that cell., but I need to see all of the records in the DataGridView rows. The color of the text is white so it's no wonder I can't see it. I have tried to find in the properties of the DataGridView how to fix this problem back I haven't had any luck. There has got to be a way of selecting the text color.
Any help would be appreciated.
Dim MySQLConnection As String = My.Settings.dbConnection
Dim dbConnection As New SqlConnection
dbConnection.ConnectionStr ing = MySQLConnection
Dim bsPatients As BindingSource
bsPatients = New BindingSource
dbConnection.Open()
Dim strSQL As String = "SELECT FirstName, LastName, Address FROM Patient WHERE LastName = '" & LastName.Text & "' ORDER BY FirstName"
Dim myDA As SqlDataAdapter = New SqlDataAdapter(strSQL, dbConnection)
'Dim myPatient As DataSet = New DataSet()
Dim myPatient As DataTable = New DataTable
myDA.Fill(myPatient)
bsPatients.DataSource = myPatient
DataGridView1.DataSource = bsPatients
dbConnection.Close()
dbConnection = Nothing
End Sub
Any help would be appreciated.
Dim MySQLConnection As String = My.Settings.dbConnection
Dim dbConnection As New SqlConnection
dbConnection.ConnectionStr
Dim bsPatients As BindingSource
bsPatients = New BindingSource
dbConnection.Open()
Dim strSQL As String = "SELECT FirstName, LastName, Address FROM Patient WHERE LastName = '" & LastName.Text & "' ORDER BY FirstName"
Dim myDA As SqlDataAdapter = New SqlDataAdapter(strSQL, dbConnection)
'Dim myPatient As DataSet = New DataSet()
Dim myPatient As DataTable = New DataTable
myDA.Fill(myPatient)
bsPatients.DataSource = myPatient
DataGridView1.DataSource = bsPatients
dbConnection.Close()
dbConnection = Nothing
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER