Sorry for the delay in following up to your response - I had trouble
creating the objects in a simple app that would replicate the error.
Until I get that finished, here is the code I am using to put data into the
dataview
private void buttonAdd_Click(object sender, System.EventArgs e)
{
DataSetGolfPool.PicksRow dr = this.DataSetGolfPool.Picks.NewPicksRow();
dr.poolie_ID=Convert.ToInt32(this.ComboBoxPoolies.SelectedValue);
dr.tournament_ID=Convert.ToInt32(this.ComboBoxTournaments.SelectedValue);
dr.golfer_ID=Convert.ToInt32(this.ListBoxGolfers.SelectedValue);
dr.fullName=Convert.ToString(this.ListBoxGolfers.SelectedItem);
this.DataSetGolfPool.Picks.AddPicksRow(dr);
}
The row filter I am using:
this.DataViewPicks.RowFilter= String.Concat( "poolie_id=",
this.ComboBoxPoolies.SelectedValue, " AND tournament_id=",
this.ComboBoxTournaments.SelectedValue);
The ListBox is bound with the following properties:
this.ListBoxPicks.DataSource = this.DataViewPicks;
this.ListBoxPicks.DisplayMember = "fullName";
this.ListBoxPicks.Location = new System.Drawing.Point(616, 80);
this.ListBoxPicks.Name = "ListBoxPicks";
this.ListBoxPicks.Size = new System.Drawing.Size(160, 108);
this.ListBoxPicks.TabIndex = 4;
this.ListBoxPicks.ValueMember = "id";
//
// SqlDataAdapterPicks
//
this.SqlDataAdapterPicks.DeleteCommand = this.sqlDeleteCommand2;
this.SqlDataAdapterPicks.InsertCommand = this.sqlInsertCommand2;
this.SqlDataAdapterPicks.SelectCommand = this.sqlSelectCommand2;
this.SqlDataAdapterPicks.TableMappings.AddRange(new
System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "Picks", new
System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("id", "id"),
new System.Data.Common.DataColumnMapping("poolie_ID", "poolie_ID"),
new System.Data.Common.DataColumnMapping("tournament_ID", "tournament_ID"),
new System.Data.Common.DataColumnMapping("golfer_ID", "golfer_ID")})});
Thanks
Derrick
> I will post it tomorrow AM
>
[quoted text clipped - 36 lines]
> > This mail should not be replied directly, please remove the word "online"
> > before sending mail.
"Ying-Shen Yu[MSFT]" - 03 Jul 2004 04:08 GMT
Hi Derrick,
Thanks for your reply,
I read your code carefully, and made a similiar program to try to reproduce
this issue, but it works fine.
Based on my current investigation, listbox will show
"System.Data.DataRowView" in these two situations:
1. the DisplayMember is null or not exist in underlying datasource.
2. An exception was thrown when listbox tries to retrieve text from the
corresponding column of the current DataRowView object.
So you may try checking the following issues:
1. print out the DisplayMember and ValueMember properties after setting
values.
2. run your program with debugger and enable catching CLR exceptions when
the exception is thrown. (You may see the options by clicking menu
"Debug"->"Exceptions") . If you get any exceptions, please include the call
stacks in your reply.
If you see [Non-User code] in your call stack, you may follow the KB
article below to load symbols to get complete call stack information.
<HOW TO: Use a Symbol Server with the Visual Studio .NET Debugger>
http://support.microsoft.com/?id=319037
If you have any updates to this issue, please feel free to post it in this
thread to let me know.
Thanks!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.