EStallworth
Well-known member
I am having trouble binding more than one object within a select case statement and do not quite understand why. I have read the post above for a similar problem, but need it explained as it seems to me that Paszt is using an array and I do not understand why. I am trying to bind several labels to certain values in a dataset based on a certain months data. It seems redundant to have to clear the bindings before I assign more. Can anyone help me understand the error?¿
Here is the error I am receiving.
Here is the error I am receiving.
"This causes two bindings in the collection to bind to the same property.
Parameter name: binding"
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] month [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Char[/COLOR][/SIZE]
[SIZE=2]month = duedatelabel.SelectedValue[/SIZE]
[SIZE=2][COLOR=#0000ff]Select[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2] month[/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"January"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"February"[/COLOR][/SIZE]
[SIZE=2]SqlDataAdapter6.SelectCommand.Parameters([/SIZE][SIZE=2][COLOR=#800000]"@Param1"[/COLOR][/SIZE][SIZE=2]).Value = ComboBox1.SelectedValue[/SIZE]
[SIZE=2]SqlDataAdapter6.Fill(DataSet331)[/SIZE]
[SIZE=2]previousadjustlabel.DataBindings.Add([/SIZE][SIZE=2][COLOR=#800000]"Text"[/COLOR][/SIZE][SIZE=2], DataSet331, [/SIZE][SIZE=2][COLOR=#800000]"January1.Unpaid Adjustments"[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]previouscollectionlabel.DataBindings.Add([/SIZE][SIZE=2][COLOR=#800000]"Text"[/COLOR][/SIZE][SIZE=2], DataSet331, [/SIZE][SIZE=2][COLOR=#800000]"January1.Unpaid Collection"[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"March"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"April"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"May"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"June"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"July"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"August"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"September"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"October"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"November"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Case[/COLOR][/SIZE][SIZE=2][COLOR=#800000]"December"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Select[/COLOR][/SIZE]
Last edited by a moderator: