473,738 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Column does not belong to Table error

Hi all,
>From vb.net 2005, I'm reading a list of XML files into a dataset and
updating SQL database with the data.I'm stuck with an issue. One of the
XML file from the list don't have a node mentioned. For example almost
all XML files structure is like this

<treatment_sett ings>
<setup>
<product1>
<name>PSO-NO2</name>
<mode>1</mode>
<setpoint>300.0 0</setpoint>
<range>12.00</range>
<density>10.630 0</density>
<tr_pf>300.00 </tr_pf>
<tp_pf>10.00</tp_pf>
</product1>
<product2>
<name />
<mode>0</mode>
<setpoint>80.00 </setpoint>
<range>4.00</range>
<density>9.4300 </density>
<tr_pf>300.00 </tr_pf>
<tp_pf>10.00</tp_pf>
</product2>
</setup>
</treatment_setti ngs>

But few liles don't have <modenode for product2. In that case I'm
getting Column does not belong to table error when I'm executing the
below code. I'm trying to save values into arrays and later in the code
I'm updating the database.
_______________ _______________ _______________ _______
objDSXML.ReadXm l(strWorkPath & "\TreatmentSett ings.xml")
j = 0
For i = 1 to 2
For Each objDataRow In objDSXML.Tables (i).Rows
ControlMethod(j ) = objDataRow("mod e")
ProductName(j) = Trim(objDataRow ("name"))
j = j + 1
Next
Next
_______________ _______________ _______________ _______
I have tried using this code to see if the node exist.

If Not IsDBNull(objDat aRow("mode")) Then
ControlMethod(j ) = objDataRow("mod e")
End If

Above code didn't work eiter.
Can any one tell me how to check if a node in the table exist?

Thanks.

Jan 9 '07 #1
1 2505
in the Table.Columns collection to see if the column exists. you could
also add the column if missing.

-- bruce (sqlwork.com)

shil wrote:
Hi all,
>>From vb.net 2005, I'm reading a list of XML files into a dataset and
updating SQL database with the data.I'm stuck with an issue. One of the
XML file from the list don't have a node mentioned. For example almost
all XML files structure is like this

<treatment_sett ings>
<setup>
<product1>
<name>PSO-NO2</name>
<mode>1</mode>
<setpoint>300.0 0</setpoint>
<range>12.00</range>
<density>10.630 0</density>
<tr_pf>300.00 </tr_pf>
<tp_pf>10.00</tp_pf>
</product1>
<product2>
<name />
<mode>0</mode>
<setpoint>80.00 </setpoint>
<range>4.00</range>
<density>9.4300 </density>
<tr_pf>300.00 </tr_pf>
<tp_pf>10.00</tp_pf>
</product2>
</setup>
</treatment_setti ngs>

But few liles don't have <modenode for product2. In that case I'm
getting Column does not belong to table error when I'm executing the
below code. I'm trying to save values into arrays and later in the code
I'm updating the database.
_______________ _______________ _______________ _______
objDSXML.ReadXm l(strWorkPath & "\TreatmentSett ings.xml")
j = 0
For i = 1 to 2
For Each objDataRow In objDSXML.Tables (i).Rows
ControlMethod(j ) = objDataRow("mod e")
ProductName(j) = Trim(objDataRow ("name"))
j = j + 1
Next
Next
_______________ _______________ _______________ _______
I have tried using this code to see if the node exist.

If Not IsDBNull(objDat aRow("mode")) Then
ControlMethod(j ) = objDataRow("mod e")
End If

Above code didn't work eiter.
Can any one tell me how to check if a node in the table exist?

Thanks.
Jan 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1541
by: mkomasi | last post by:
I am using a datagrid in my form sometimes when a child form of this datagrid form closed an exception like "Column C does not belong to the table T" was thrown. this exception is rarely occured so rarely and I can not find the way that it was generated, so I can not debug the the exception. does anybody know how to generate this exception and how to handle it.
7
1697
by: Patrick Olurotimi Ige | last post by:
I have a simple Stored Procedure with multiple select statements..doing select * from links for example. I created a DataTable and then fill the tables But the first dtTemplate DataTable doesn't give the error but the links does! I get the error on this LINE(when looping):- PageLinks.Text = PageLinks.Text & dtLinks.Rows(iLoop)("link_url")
5
8492
by: Kejpa | last post by:
Hi, How do you write a Rowfilter for a boolean column? col1=true col1='true' col1= 1 col1= -1 Will all render an exception: Column 'col1' does not belong to table Test. Any thoughts?
10
2344
by: Nick | last post by:
Hello, Please pardon my ignorance as I'm sure this is easy to do. I have a datagrid where I want to let the user delete columns. I added a context menu to the datagrid that has a delete option. If the user right clicks on a column heading can I highlight that column and then delete it? I'm not exactly sure how to highlight it or figure out what column has been clicked. In my testing so far when I use the context menu I always get the...
0
1602
by: Mike | last post by:
We are using .NET 2.0 and intermittently egt the following errors on almost all our web pages. The error is not repoducable and cycling the worker process seems to temporarily fix the problems. Has anyone seen this or have any suggestions? Event code: 3005 Event message: An unhandled exception has occurred. Event time: 9/5/2006 4:23:47 PM Event time (UTC): 9/5/2006 11:23:47 PM Event ID: cb408727296440278fb486579b359b15
4
15287
by: Mike | last post by:
We are using .NET 2.0 and intermittently egt the following errors on almost all our web pages. The error is not repoducable and cycling the worker process seems to temporarily fix the problems. Has anyone seen this or have any suggestions? Event code: 3005 Event message: An unhandled exception has occurred. Event time: 9/5/2006 4:23:47 PM Event time (UTC): 9/5/2006 11:23:47 PM Event ID: cb408727296440278fb486579b359b15
2
5658
by: Ronald S. Cook | last post by:
In the code below, I get a runtime error where indicated. The error is: "Column 'TICKETNO' does not belong to table TICKET_DEDUCTIONS." If I put a breakpoint on that line (so not yet executed) and type ?dedrow(c), It says basically the same thing: Run-time exception thrown : System.ArgumentException - Column 'TICKETNO' does not belong to table TICKET_DEDUCTIONS.
1
2250
by: satishkhachane | last post by:
-------------------------------------------------------------------------------- I want to select one or more columns from one typed datatable and add it to another table . how I can do this ? Eg :- table master it has column masterid , mastername now i select masterid and assign it to new comlunm.
1
12296
by: majidkorai | last post by:
Hey Guyz I am having problem when i read the data from a datareader into a data table. The whole scenario is this that I want to read data from two diffrent databases, the table strcutre is same. You can say that other one is the copy of 1st one. I want to read out the data from one table in one database and merge the results with the one read form the other database. What i am doing is reading data from two databases into data...
0
9334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9259
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.