Text not visible in DataGridView1 VB.Net 2005
Posted on 2008-10-23
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.ConnectionString = MySQLConnection
Dim bsPatients As BindingSource
bsPatients = New BindingSource
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
bsPatients.DataSource = myPatient
DataGridView1.DataSource = bsPatients
dbConnection = Nothing