Q
Problem solve Get help with specific problems with your technologies, process and projects.

When I declare a variable of type dsPatient in my XML Schema Class Library , the 'column properties'

I built a Class Library in which I included an XML Schema. It has a single element called "tblPatient" with a bunch of attributes. The XML Schema is called dsPatient.

If I declare a variable of type dsPatient, I get all of the attributes like properties of the tblPatient table like this:

dsTest.tblPatient.PatientIDColumn
dsTest.tblPatient.LastNameColumn
dsTest.tblPatient.FirstNameColumn

... and so forth.

But when I include a reference of this Class Library in a Windows application and declare a variable of type dsPatient, I can get the "tblPatient" as a property, but all of the "Column Properties" are gone. Since this is a typed dataset, I would expect to see those columns as properties but they are gone. Why is this happening? How can I correct this? Thank you very much in advance for your help.
First, you're not including an XML Schema but a DataSet schema. Those are different things. The former does not generate any code (i.e. the typed dataset class).

Second, keep in mind that when you write the following code dsTest.tblPatient.PatientIDColumn, you're accessing the column definition data, but not any row data. When you access a row, you will get the typed properties using dsTest.tblPatient[0].PatientID.

As far as accessing the column definition data itself, it's automatically generated with internal visibility, that's why you don't see it from outside the project. Select Project -> Show All Files, and expand the dataset schema. You will see two files below it -- one of them is the automatically generated class. Look for the corresponding table and you'll see it. I don't know why this isn't an option we can choose, but it's certainly an inconvenience you'll have to live with for now.

Dig Deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

TheServerSide.com

Close