user3658555
user3658555

Reputation: 17

column does not belong to table

try
        {
            objConn.Open();
            connexion.da = new SqlCeDataAdapter("Select NUM_PHY ,NOM_CLI ,NUM_FAC  ,DATE_FACT ,MODE_PAIEMENT   ,DATE_REG  from EXP WHERE NOM_CLI=@client  =@vari", objConn);
            da.SelectCommand.CommandType = CommandType.Text;
            da.SelectCommand.Parameters.Add("@client", client);

            da.Fill(ds,"EXP");


            DataRow drow = ds.Tables["EXP"].Rows[0];
            MessageBox.Show(drow["NOM_CLI"].ToString());

            MessageBox.Show(drow["NUM_PHY"].ToString());

I have this error :column 'NUM_PHY' does not belong to table EXP.

Why this column and not others?

Upvotes: 0

Views: 5445

Answers (2)

Sunil
Sunil

Reputation: 150

Kindly check whether the column with the name "NUM_PHY" exists, and also I hope there has been no change in regional settings.

Upvotes: 0

Mohamed
Mohamed

Reputation: 520

Modify your code

DataRow drow = ds.Tables["EXPORT"].Rows[0];

with

DataRow drow = ds.Tables["EXP"].Rows[0];

Since you are filling the value in "EXP" Table.

Upvotes: 1

Related Questions