No 'findby' method in strongly typed dataset

A

Andrew

Hi - I've read several posts around this subject but not found one that
solved my problem. I have created an XSD in my VB.NET project using
drag and drop. I've created a primary key on one table - the underlying
xsd confirms that the msdata:primaryKey attribute of this xs:key
element is "true".

However when I generate my vb.net strongly typed dataset class, there
is no 'findby' method when the documentation and other posts here
suggest there should be.

I've tried adding the attribute msdata:unique="true" to the key
element, and also tried changeing the element name from xs:key to
xs:unique - still no 'findby' method.

Any ideas gratefully recieved .... thanks

Andrew Stephen
 
S

Scott M.

What documentation are you referring to that make reference to "findby".
I've never heard of it. What is it supposed to do?
 
A

Andrew

Scott - Sorry I should have been more accurate in my description of the
method name - its 'FindBy' and the name of the primary key. e.g. if the
primary dataset key is called OrderID, the generated method should be
called FindByOrderID.

Look at http://msdn.microsoft.com/msdnmag/issues/04/12/DataPoints/ -
its mentioned there, and several times in the dotnet.framework.adonet
group.
 
S

Scott M.

FindBy... is not a method of a strongly typed dataset, it is a method of a
table IN a strongly typed dataset.

Dim ds As New StronglyTypedDataSetTypeHere
ds.TableNameDisplayedAsAPropertyHere.FindByPrimaryKeyHere
 
S

Scott M.

If you look at the article carefully, it says:

" a typed DataSet based on the Northwind database's Orders table would
expose the method FindByOrderID"

Notice it says the "Orders table would expose the method..", it doesn't say
the dataset exposes the method.

I have checked this with a strongly typed dataset of my own and found that
the table (exposed as a property of the dataset) does, in fact, expose this
method.

-Scott
 
A

Andrew

Thanks - Everything you say is correct; yes, 'findby' is a method of a
datatable in a strongly typed dataset. However my datatable on which my
primary key is defined, within my strongly typed dataset, does not have
a generated 'findby' method. Could you post the snippet of XSD code
that defines your datatable primary key so I can compare with mine ....
thanks.
 

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