ygmail:Is there some kind of feature like "Generate dataset" like in VS.net 2003? I like that function very much. Or is there some alternative?
I use MS Access (.mdb) databases.
No, I don't think there is. Check this thread. But there is the hard way.
I'm a user of Visual Studio .NET 2003 myself (at work), and I explored typed datasets in #d just yesterday. Here is what I found about building typed datasets in #d.
1. You have to manually edit a dataset schema as a XSD schema file (add an empty XML file to your project and name it with the .xsd extension). You need to have a good knowledge of the XSD schema for that.
The XSD schema definition can be found on the W3 Consortium Web site and on MSDN Library. The "Working With A Typed Dataset" section in MSDN Library gives a good example.
2. Microsoft extended the schema with its own additions for use of datasets.
When you edit a schema with the VS.NET XML Editor, you can set dataset properties which are represented in the schema by attributes in the msdata namespace (urn:schemas-microsoft-com:xml-msdata).
For example, to have a DataColumn behave as an autonumber (as in Access), you set its AutoIncrement property to "True", or it can be set as such in the XML Editor. In the schema, it's represented as a msdata:AutoIncrement="True" attribute. Such dataset properties that are not part of the standard XSD schema seem to be available in the msdata namespace.
Well, this msdata schema is not documented anywhere. I only found a reference to it on MSDN Library in a page about the XML Editor Schema Cache. That led me to the msdata XSD Schema, which is installed by VS.NET (I had installed Visual Web Developer 2005 before). So if you want to set a special dataset property (not part of the standard XSD schema, that is), you can check if it exists in the msdata.xsd file. (In other words, check first in the dataset and datacolumn documentation in the .NET Class Library reference, and if you see a property you want to use, check its existence in msdata.xsd.)
There are also annotations defined by the codegen namespace, but they're documented in MSDN Library.
The schema can also be generated from a XML file; see the documentation for XSD.EXE, which I discuss on next point.
3. Once your XSD schema is ready, you can manually generate the code behind with the XSD.EXE command-line tool which comes with the .NET Framework SDK. It is also documented on MSDN Library. I suggest you use the .NET Framework SDK command-line shortcut in the Start menu rather that the regular command-line, since it configures the .NET command-line utilities folder in the default path.
4. Once the code behind file (.VB or .CS) is generated, import it in your projet (add an existing file).
That's it. The hard part is making the XSD. Well, it's not that hard, just tedious.
ygmail:(By the way: maybe my English is not very well, this because I am Dutch)
Don't worry. (By the way, it's "my English is not very good".) I'm a French speaker myself, and many here aren't native English speakers.
In any case, here is the msdata schema (msdata.xsd). I guess it could be possible to add it to the XML Schemas options so code completion works with the #d XML editor.
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema version="1.1.0" targetNamespace="urn:schemas-microsoft-com:xml-msdata"
elementFormDefault="qualified"
attributeFormDefault="qualified"
xmlns="urn:schemas-microsoft-com:xml-msdata"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:attribute name="AcceptRejectRule" type="xs:string" default="none">
</xs:attribute>
<xs:element name="Relationship">
<xs:complexType>
<xs:sequence />
<xs:attribute name="RelationName" type="xs:string">
</xs:attribute>
<xs:attribute name="parent" type="xs:string">
</xs:attribute>
<xs:attribute name="child" type="xs:string">
</xs:attribute>
<xs:attribute name="parentKey" type="xs:string">
</xs:attribute>
<xs:attribute name="childKey" type="xs:string">
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:attribute name="ColumnName" type="xs:string">
</xs:attribute>
<xs:attribute name="ConstraintName" type="xs:string">
</xs:attribute>
<xs:attribute name="ConstraintOnly" type="xs:boolean">
</xs:attribute>
<xs:attribute name="CaseSensitive" type="xs:boolean" default="false">
</xs:attribute>
<xs:attribute name="DeleteRule" type="xs:string" default="cascade">
</xs:attribute>
<xs:attribute name="Error" type="xs:string">
</xs:attribute>
<xs:attribute name="IsDataSet" type="xs:boolean" default="false">
</xs:attribute>
<xs:attribute name="IsNested" type="xs:boolean" default="false">
</xs:attribute>
<xs:attribute name="Locale" type="xs:string" default="en-us">
</xs:attribute>
<xs:attribute name="Ordinal" type="xs:integer">
</xs:attribute>
<xs:attribute name="UpdateRule" type="xs:string" default="cascade">
</xs:attribute>
<xs:attribute name="rowOrder" type="xs:integer">
</xs:attribute>
<xs:attribute name="hiddenColumn" type="xs:boolean">
</xs:attribute>
<xs:attribute name="EnforceConstraints" type="xs:boolean">
</xs:attribute>
<xs:attribute name="Prefix" type="xs:string" default="">
</xs:attribute>
<xs:attribute name="AutoIncrementSeed" type="xs:long">
</xs:attribute>
<xs:attribute name="AutoIncrement" type="xs:boolean" default="false">
</xs:attribute>
<xs:attribute name="AutoIncrementStep" type="xs:long" default="1">
</xs:attribute>
<xs:attribute name="Caption" type="xs:string">
</xs:attribute>
<xs:attribute name="ReadOnly" type="xs:boolean" default="false">
</xs:attribute>
<xs:attribute name="Sparse" type="xs:boolean" default="false">
</xs:attribute>
<xs:attribute name="AllowDBNull" type="xs:boolean" default="true">
</xs:attribute>
<xs:attribute name="DataType" type="xs:string">
</xs:attribute>
<xs:attribute name="DefaultValue" type="xs:string">
</xs:attribute>
</xs:schema>
Taxus