Serializing datasets

D

Doug Eller

I am serializing datasets and sending them out to a client application via a
web service. My problem is that the associated schema includes all of my
connection string, database username and password and SQL info. This is bad.
I can think of two ways to deal with this:

1. Parse the data out of the schema before i send it out
2. Encrypt the data

My question is......is there a better way?
 
C

CJ Taylor

How does your schema contain this information?

You Schema is only a blueprint, your dataadapters/datacommands contain
connection info, not the schema.

-CJ
 
D

Doug Eller

Actually, the result of:

myXmlSerializer.serialize(myStream, myDataSet)

is a schema(the description of the dataset)and xml(the data in the dataset).
The schema contains ALL of the information about the dataset, including
connection strings, SQL, etc. But - and here is where I actually discovered
the answer to my own question yesterday afternoon - the connection strings
and SQL info are all stored, prior to serialization, in a property of the
datatable class called ExtendedProperties. This property is a hashtable
that, itself, has a method called ExtendedProperties.Remove(myProperty).
Invoke this, pass it the name of the property you don't want serialized and
BAM!........no SQL or connection strings in your serialized dataset. Now, in
my situation, my web service is authenticating users and can, therefore,
easily determine if the user is someone who needs the database info or not
and then include or remove that info accordingly.

I hope this helps anyone else who has the problem. Also, if anyone knows
another way to go about what I am doing, let me know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top