Click here to Skip to main content
15,924,935 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Controlling FileSystemWatcher Pin
DSAlbin21-May-06 7:41
DSAlbin21-May-06 7:41 
GeneralRe: Controlling FileSystemWatcher Pin
Wrongway432123-May-06 12:17
Wrongway432123-May-06 12:17 
GeneralRe: Controlling FileSystemWatcher Pin
DSAlbin23-May-06 13:17
DSAlbin23-May-06 13:17 
GeneralRe: Controlling FileSystemWatcher Pin
Wrongway432124-May-06 10:55
Wrongway432124-May-06 10:55 
GeneralRe: Controlling FileSystemWatcher Pin
DSAlbin24-May-06 12:22
DSAlbin24-May-06 12:22 
QuestionDataGrid Control Pin
Quecumber2569-May-06 10:27
Quecumber2569-May-06 10:27 
Questionhandler problem Pin
meconomou9-May-06 8:18
meconomou9-May-06 8:18 
Questioncombo box Data source Nothing Problem Pin
Hkothari779-May-06 8:02
Hkothari779-May-06 8:02 
I've got a very weird problem, when I run the following code the
ComboBox (Me.cmbInputDevice) is always empty. The ComboBox is on a
UserControl in a Class Library. I'm using VS.NET 2003 with SourceSafe
6.0d (the problem occurs whether the code is checked in or out)

If I step through the code, The line

Me.cmbInputDevice.DataSource = dv

Executes fine (ie, doesn't error), but on the next line (after an
F8/F11) Me.cmbInputDevice.DataSource is still equal to Nothing.

dv is definately not Nothing, and is definately not empty (I can view
it's contents in the Command Window)

*if* I delete the combo box from the control, and add a new one, give it
the same name, etc, it works for a while, but then goes back to
not-working after an unknown period. This isn't any kind of practical
solution.


Sql.GetDeviceTable() returns a valid & populated DataTable

[VB.NET] (Native Language)

Dim dt As DataTable = Sql.GetDeviceTable()

Dim dr As DataRow = dt.NewRow()
dr("ID") = DBNull.Value

dr("Description") = "<none>"

dt.Rows.Add(dr)

Dim dv As DataView = dt.DefaultView
dv.Sort = "Description"
dv.ApplyDefaultSort = True

Me.cmbInputDevice.DataSource = dv
Me.cmbInputDevice.DisplayMember = "Description"
Me.cmbInputDevice.ValueMember = "ID"

[C#] (Translation)

DataTable dt = Sql.GetDeviceTable();

DataRow dr = dt.NewRow();
dr("ID") = DBNull.Value;

dr("Description") = "<none>";

dt.Rows.Add(dr);

DataView dv = dt.DefaultView;
dv.Sort = "Description";
dv.ApplyDefaultSort = True;

this.cmbInputDevice.DataSource = dv;
this.cmbInputDevice.DisplayMember = "Description";
this.cmbInputDevice.ValueMember = "ID";



Hiren

-- modified at 14:04 Tuesday 9th May, 2006
AnswerRe: Data source Still Nothing Problem Pin
Hkothari779-May-06 8:04
Hkothari779-May-06 8:04 
QuestionHow to cut part of the piture in a picture box Pin
Murtuza Husain Miyan Patel9-May-06 7:58
professionalMurtuza Husain Miyan Patel9-May-06 7:58 
AnswerRe: How to cut part of the piture in a picture box Pin
Christian Graus9-May-06 10:39
protectorChristian Graus9-May-06 10:39 
QuestionAdding nodes to a treeview control Pin
Raistlin21_459-May-06 7:25
Raistlin21_459-May-06 7:25 
AnswerRe: Adding nodes to a treeview control Pin
digicd19-May-06 16:22
digicd19-May-06 16:22 
GeneralRe: Adding nodes to a treeview control Pin
Raistlin21_4510-May-06 6:01
Raistlin21_4510-May-06 6:01 
AnswerRe: Adding nodes to a treeview control Pin
Hacknight949-May-06 20:37
Hacknight949-May-06 20:37 
GeneralRe: Adding nodes to a treeview control Pin
Raistlin21_4510-May-06 6:05
Raistlin21_4510-May-06 6:05 
GeneralRe: Adding nodes to a treeview control Pin
Hacknight9410-May-06 14:15
Hacknight9410-May-06 14:15 
GeneralRe: Adding nodes to a treeview control Pin
Hacknight9410-May-06 14:21
Hacknight9410-May-06 14:21 
Questionfrom ADO to ADO.NET 2.0 Pin
Gulfraz Khan9-May-06 6:11
Gulfraz Khan9-May-06 6:11 
QuestionHandling Complex Numbers Pin
crtwrght_mrk9-May-06 6:09
crtwrght_mrk9-May-06 6:09 
AnswerRe: Handling Complex Numbers Pin
darkelv9-May-06 6:25
darkelv9-May-06 6:25 
QuestionRe: Handling Complex Numbers Pin
crtwrght_mrk9-May-06 9:34
crtwrght_mrk9-May-06 9:34 
Question&quot;load report failed&quot; error Pin
sarah_chandran9-May-06 5:05
sarah_chandran9-May-06 5:05 
AnswerRe: &amp;quot;load report failed&amp;quot; error Pin
penguin500011-May-06 20:05
penguin500011-May-06 20:05 
Questionhow to export crystal report from vb in pdf format Pin
virendra_sw9-May-06 3:48
virendra_sw9-May-06 3:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.