ComboBox problem
-
Dear coders, I think i am fallen in simple problem but i can't fix it.Please Help me. Problem is:i take a combobox in a datagridview. i just change the Column type and i wrote this code: RoomTypeBLL objRoomTypeBLL = new RoomTypeBLL(); colType.DataSource = objRoomTypeBLL.GetAllRoomTypeData(); colType.ValueMember = "fldRoomTypeAutoID"; colType.DisplayMember = "fldTypeName"; How i save combobox value member value into database? Thanks in advance
-
Dear coders, I think i am fallen in simple problem but i can't fix it.Please Help me. Problem is:i take a combobox in a datagridview. i just change the Column type and i wrote this code: RoomTypeBLL objRoomTypeBLL = new RoomTypeBLL(); colType.DataSource = objRoomTypeBLL.GetAllRoomTypeData(); colType.ValueMember = "fldRoomTypeAutoID"; colType.DisplayMember = "fldTypeName"; How i save combobox value member value into database? Thanks in advance
I am confused. What is actually the problem? Does your code not compile? Does it crash at run-time? Does it not display the data correctly? Can't you edit it? Or it it that you don't know how to save to the db? If so, what does it have to do with the combo box? Databases usually don't have strong opinions about how data should be edited outside of the database. Most of them are only fussy about who they give out data to and who gets to update them, and sometimes what data they will accept. Also, from the code you posted it appears you are using some form or shape of business layer, so saving is probably done by calling a method on the business object. But how people out here in the world can be expected to know the design of your business objects better than you do is beyond me.