|
-
Aug 17th, 2006, 03:30 AM
#1
Thread Starter
Addicted Member
Weird combobox problem
Hi! I am experiencing a very strange problem with my combobox. I am currently using the code
VB Code:
Dim rs As New ADODB.Recordset()
cboObject.Items.Clear()
rs.Open(strQuery, Cnn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
If Not rs.EOF Then
rs.MoveFirst()
Do While Not rs.EOF
cboObject.Items.Add(rs.Fields(0).Value)
rs.MoveNext()
Loop
End If
rs.Close()
Whenever I run the system, the combobox returns as blank. Here's the weird part, there is a long list of blank entries, if I chose the second one, it will suddenly appear in my combobox. It is like they are invisible or something. The second weird part is after a few minutes the list will suddenly become visible again. I've never encountered this problem before and neither have my coworkers. Please help!
-
Aug 17th, 2006, 04:19 AM
#2
Re: Weird combobox problem
Don't use a Recordset for a start, and don't use ADO at all. Use ADO.NET, retrieve the data into a DataTable and assign that to the DataSource of the ComboBox, or else use a DataReader to get the values one by one and add them.
Having said that, if you've got blank entries then you got entries. Either you've set the ForeColor and the BackColor to the same value, which is unlikely, or it may something else interfering. Do you have any McAfee products installed? There's a well-documented bug that causes text to disappear in .NET apps.
-
Aug 17th, 2006, 05:06 AM
#3
Thread Starter
Addicted Member
Re: Weird combobox problem
Is there any way to go around the McAfee bug? I'm afraid that is the standard Virus Scanner for our company.
-
Aug 17th, 2006, 05:32 AM
#4
Re: Weird combobox problem
They have posted a patch on their Web site. I'm sure someone has posted a link at least once before. Try search the forum first, then the McAfee site.
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
|