Datamember property 'tblComboBoxLkUp' cannot be found on the datasource

I have one combobox and one datagrid.  The combobox has the pk that connects to the datagrid.  
I would like to pick a combobox and show the details  of the selection in the datagrid.

I get error "Datamember property 'tblComboBoxLkUp' cannot be found on the datasource during the following statement:
CbMtd.DataSource = BindSrceMtd;
CbMtd.DisplayMember = "tblComboLkUp.Name_Lk";

I've checked spelling, case and I still can't figure out what is wrong with this!!  Please HELP!!!!

This is the rest of the code that I have:

 Ds = new DataSet();
 Cmd = new SqlCommand(SProcLkUp, CohortConn);
                Cmd.CommandType = CommandType.StoredProcedure;
 Da = new SqlDataAdapter(Cmd);
 Da.Fill(Ds, "tblComboLkUp");

//the above gets the information from the look up table that will be stored in the combobox

 Cmd 2= new SqlCommand(SProcDetails, CohortConn);
                Cmd2.CommandType = CommandType.StoredProcedure;
 Da2 = new SqlDataAdapter(Cmd)2;
 Da2.Fill(Ds2, "tblDetails");

//the above is the dataset that contains details.

 DataRela = new DataRelation(MtdDetails, Ds.Tables["tblComboLkUp"].Columns["ColNm1"], Ds.Tables["tblDetails"].Columns["ColNm2"], false);

//data relation between combo and detail

 BindSrceMtd.DataSource = Ds;
 BindSrceMtd.DataMember = "tblComboLkUp";

BindSrceMtdDetail.DataSource = BindSrceMtd;
BindSrceMtdDetail.DataMember = "MtdDetails";//binded to relationship

DgvMtdDesc.DataSource = BindSrceMtdDetail;//datagrid bound to detail

CbMtd.DataSource = BindSrceMtd;
CbMtd.DisplayMember = "tblComboLkUp.Name_Lk";
CbMtd.ValueMember = "tblComboLkUp.ID_Lk";

Who is Participating?
CbMtd.DisplayMember = "Name_Lk";
yanci1179Author Commented:
Anybody?  Pleasssseeee
yanci1179Author Commented:
such a small mistake has driven be crazy for the past 2 days!!!!  

thanks you SO MUCH for you help!!!!
yanci1179Author Commented:
just curious, why does it not take "tblComboLkUp.Name_Lk"?
Table name (tblComboLkUp) is specified in DataMember property of the binding source. In DisplayMember property you specify a field from the datasource from where the values displayed in combobox are taken. You don't need to mention the TableName again.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.