473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Question on XML and Dataset

I am creating an XML webservice where by I am sending the a string of
XML to the consumer.
The consumer receives the XML and converts into dataset and able to
update the rows to the database. The problem I am having is when I
create the intial dataset in XML web service, I use the ADO.net to
populate the dataset, as I have some columns having null values for
certain rows, especially datefields, those are not sent over in the XML
or dataset generated.
So while parsing the XML or traversing the dataset in the client side
for the date column, obviously I will get the error, I am not sure what
other ways I can do to prevent it.

I thought of adding codegen and Typed dataset, is that the only option,
even then I have to default to a certain value right ? Any help is
appreciated.

Jul 19 '06 #1
5 1279
After the consumer reads the xml into a dataset, check for the existance of
the column(s) in question. Or, before sending the xml check it for the
existance of the columns. Checking the data is always the best way to
prevent problems.


<sr**************@gmail.comwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
>I am creating an XML webservice where by I am sending the a string of
XML to the consumer.
The consumer receives the XML and converts into dataset and able to
update the rows to the database. The problem I am having is when I
create the intial dataset in XML web service, I use the ADO.net to
populate the dataset, as I have some columns having null values for
certain rows, especially datefields, those are not sent over in the XML
or dataset generated.
So while parsing the XML or traversing the dataset in the client side
for the date column, obviously I will get the error, I am not sure what
other ways I can do to prevent it.

I thought of adding codegen and Typed dataset, is that the only option,
even then I have to default to a certain value right ? Any help is
appreciated.

Jul 19 '06 #2
Thanks Scott. I will check the column existence then.

Scott M. wrote:
After the consumer reads the xml into a dataset, check for the existance of
the column(s) in question. Or, before sending the xml check it for the
existance of the columns. Checking the data is always the best way to
prevent problems.


<sr**************@gmail.comwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
I am creating an XML webservice where by I am sending the a string of
XML to the consumer.
The consumer receives the XML and converts into dataset and able to
update the rows to the database. The problem I am having is when I
create the intial dataset in XML web service, I use the ADO.net to
populate the dataset, as I have some columns having null values for
certain rows, especially datefields, those are not sent over in the XML
or dataset generated.
So while parsing the XML or traversing the dataset in the client side
for the date column, obviously I will get the error, I am not sure what
other ways I can do to prevent it.

I thought of adding codegen and Typed dataset, is that the only option,
even then I have to default to a certain value right ? Any help is
appreciated.
Jul 19 '06 #3
Check
http://support.microsoft.com/default...b;en-us;318039

I'm not sure if it puts a filler <elementin .. when there isn't a value.

"srini" <sr**************@gmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Thanks Scott. I will check the column existence then.

Scott M. wrote:
After the consumer reads the xml into a dataset, check for the existance
of
the column(s) in question. Or, before sending the xml check it for the
existance of the columns. Checking the data is always the best way to
prevent problems.


<sr**************@gmail.comwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
>I am creating an XML webservice where by I am sending the a string of
XML to the consumer.
The consumer receives the XML and converts into dataset and able to
update the rows to the database. The problem I am having is when I
create the intial dataset in XML web service, I use the ADO.net to
populate the dataset, as I have some columns having null values for
certain rows, especially datefields, those are not sent over in the
XML
or dataset generated.
So while parsing the XML or traversing the dataset in the client side
for the date column, obviously I will get the error, I am not sure
what
other ways I can do to prevent it.
>
I thought of adding codegen and Typed dataset, is that the only
option,
even then I have to default to a certain value right ? Any help is
appreciated.
>

Jul 19 '06 #4
Use Convert.IsDBNull method to check for null and then set the parsed
string from XML to vbnullstring while forming the dataset.

This works!

Ramya

sr**************@gmail.com wrote:
I am creating an XML webservice where by I am sending the a string of
XML to the consumer.
The consumer receives the XML and converts into dataset and able to
update the rows to the database. The problem I am having is when I
create the intial dataset in XML web service, I use the ADO.net to
populate the dataset, as I have some columns having null values for
certain rows, especially datefields, those are not sent over in the XML
or dataset generated.
So while parsing the XML or traversing the dataset in the client side
for the date column, obviously I will get the error, I am not sure what
other ways I can do to prevent it.

I thought of adding codegen and Typed dataset, is that the only option,
even then I have to default to a certain value right ? Any help is
appreciated.
Jul 19 '06 #5
That won't work if the column doesn't exist, only if the column exists but
there is no data value in the column.
"Ramya A" <ra**********@gmail.comwrote in message
news:11**********************@s13g2000cwa.googlegr oups.com...
Use Convert.IsDBNull method to check for null and then set the parsed
string from XML to vbnullstring while forming the dataset.

This works!

Ramya

sr**************@gmail.com wrote:
>I am creating an XML webservice where by I am sending the a string of
XML to the consumer.
The consumer receives the XML and converts into dataset and able to
update the rows to the database. The problem I am having is when I
create the intial dataset in XML web service, I use the ADO.net to
populate the dataset, as I have some columns having null values for
certain rows, especially datefields, those are not sent over in the XML
or dataset generated.
So while parsing the XML or traversing the dataset in the client side
for the date column, obviously I will get the error, I am not sure what
other ways I can do to prevent it.

I thought of adding codegen and Typed dataset, is that the only option,
even then I have to default to a certain value right ? Any help is
appreciated.

Jul 20 '06 #6

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

Similar topics

3
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid...
2
by: JS | last post by:
I'm trying to create a data layer and having problems returning a DataSet from my code that's in a class module. Please forgive me. I'm new to C# (VB'er). I decided to create my data layer in...
1
by: Mike Malter | last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I can call that method again later using reflection. I am...
1
by: PCC | last post by:
I am writing a data access layer for a web service. Data from the web service is to be returned as XML. My design dilemma is this... Should I be returning XML from my stored procedures using...
2
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid...
0
by: Mike | last post by:
Hi, I am trying to solve a problem with a DataSet issue I am having. In my app the user selects certain options and based on those options it goes out to the db to get data based on those...
6
by: rodchar | last post by:
Hey all, I'm trying to understand Master/Detail concepts in VB.NET. If I do a data adapter fill for both customer and orders from Northwind where should that dataset live? What client is...
1
by: Kevin S. Goff | last post by:
Hi, all, Hopefully this will make sense: I have 2 classes that implement the same generic interface. public interface IAgingReport<T> { T GetAgingReport(DateTime dAsOfDate); }
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
15
by: Andrew Meador | last post by:
I am working on an application that will store data in SQL Server 2005 Express. The database will reside on our server at the office. I need to write an application that can work with this data off...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.