Exeception with Data

  • Thread starter Thread starter Ronny
  • Start date Start date
R

Ronny

I encounter a problem in which I can't fetch the value of a column as
follows. This happen only in the first column IP_ADDRESS which is defined as
VARCHAR(25) in the table. I gate the following error

Column 'IP_ADDRESS' does not belong to table NODE_LOCATION

Can someone help me please?

Regards

Ronny

foreach (DataRow AscendingDataRow in AscendingDataRows)

{

string ip_address = (string)AscendingDataRow["IP_ADDRESS"];// causes
exception : Column 'IP_ADDRESS' does not belong to table NODE_LOCATION

int BoudRate = (int)AscendingDataRow["ACTUAL_UPLINK_BANDWIDTH"];// work fine
 
Hi,

does the query which fetches data from db to create the DataTable (which
rows are in AscendingDataRows) query this specific column. If not, then it
wouldn't be in the datarow either.
 
Thanks,
You are right. The relevant column was missing from the select string.
Regards
Ronny
Teemu Keiski said:
Hi,

does the query which fetches data from db to create the DataTable (which
rows are in AscendingDataRows) query this specific column. If not, then it
wouldn't be in the datarow either.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://aspadvice.com/blogs/joteke

Ronny said:
I encounter a problem in which I can't fetch the value of a column as
follows. This happen only in the first column IP_ADDRESS which is defined
as VARCHAR(25) in the table. I gate the following error

Column 'IP_ADDRESS' does not belong to table NODE_LOCATION

Can someone help me please?

Regards

Ronny

foreach (DataRow AscendingDataRow in AscendingDataRows)

{

string ip_address = (string)AscendingDataRow["IP_ADDRESS"];// causes
exception : Column 'IP_ADDRESS' does not belong to table NODE_LOCATION

int BoudRate = (int)AscendingDataRow["ACTUAL_UPLINK_BANDWIDTH"];// work
fine
 
Back
Top