5
Answers

Datatable objects not binded to combobox and textbox

public void SendRoomIDtoCheckINNew(int RID)
{
try
{
object[,] ParamArray = new object[,] { { "@RoomID", RID } };
DataSet ds = new DataSet();
ds = DB.ExecuteQuery_SP("SelectRoomDetailsForGridByID", ParamArray);
if (ds.Tables.Count > 0)
{
cmbroomcat.DataSource = ds.Tables[0];
cmbroomcat.Text = ds.Tables[0].Rows[0]["RoomCategoryName"].ToString();
cmbroomno.DataSource = ds.Tables[0];
cmbroomno.DisplayMember = ds.Tables[0].Rows[0]["RoomNo"].ToString();
cmbroomno.Text = ds.Tables[0].Rows[0]["RoomNo"].ToString();
//cmbroomno.ValueMember = ds.Tables[0].Rows[0]["RoomID"].ToString();
txtCapacity.Text= ds.Tables[0].Rows[0]["RoomCapacity"].ToString();
}
}
catch (Exception ex) { ex.ToString(); }
}
 
 
above is my code but when i try to bind dt object to respective combo box and textbox it is not binding what is the reason behing it i am still confussing 
 

Answers (5)