hey all...i have a problem when i try to add item to combobox..i have a combobox in my form which is named as cmbfirma...and i fill it with a column from my database....and i want user to add new firm if there is no exist in database...and for that i used the code below
cmd.Parameters.AddWithValue("@firma",cmbFirma.SelectedItem.ToString());
and here it writes to the database as System.Data.DataRowView...and i tried to another code below
cmd.Parameters.AddWithValue("@firma",cmbFirma.SelectedValue.ToString());
but this time it writes database normally but if i want to add new firm from txt file it gives error...and it says "Unable to set an object reference to an instance object"
what can i do to get rid off here ??
Combobox item adding
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

carle lai40 reputationPosted Feb 2, 2010, 9:06 PM EST
Kirtan PatelRank #292 · 8.6K reputationPosted Feb 2, 2010, 9:37 PM EST
Erdinc Kolukisa109 reputationPosted Feb 2, 2010, 10:21 PM EST
i got rid off the problem