Data Set Base Default Vaules

  • Thread starter Thread starter Bob Day
  • Start date Start date
B

Bob Day

Using vs 2003, vb.net, MSDE...

Is there any way to set the DataSet base default values, so that each
subsequent instantiation of that base autmatically takes those default
values as their default values?

The following line only creates a default value for an instantiation of the
DataSet base, not the base itself. Meaning, each time you instantiate the
base you must instantiated all default values again for that new
instantiation.
DataSet.DataTable.ColumnName.DefaultValue = "x"

Thanks!

Bob Day
 
Bob,
If I follow your question:

Have you considering creating a "template" dataset, that you then use
DataSet.Clone to get a working copy form? Once the "template" is defined,
you use DataSet.Clone from the template instead of New DataSet...

Alternatively you can define the structure (& defaults) for your DataSet in
a XSD file, then follow "New DataSet" with DataSet.ReadXmlSchema.

A third option is to define the XSD file, and enable the "Generate Dataset"
option making it a Typed Dataset.

Hope this helps
Jay
 
Hi Bob,

Maybe others understand but I do not.
DataSet.DataTable.ColumnName.DefaultValue = "x"
Which columname is this?

But you can of course make a default datatable and than clone that to the
new.
It copies than only the schema and constraints

I hope this helps?

Cor
 
ColumnName is any column name, it doesn't matter. But, I think the cloning
is a great idea and the way to go.

Thanks!
Bob Day
 
Hi Bob,

Thanks for using Microsoft MSDN Managed Newsgroup.
If you have concern on this issue, please post here, I will glad to help
you.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Peter,

If there is something wrong with my answer, please describe it to me I
always love to learn.

Cor
 
Back
Top