Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > DataMappingType in the DataSet Designer

Reply
Thread Tools

DataMappingType in the DataSet Designer

 
 
Alexander Walker
Guest
Posts: n/a
 
      04-08-2006
Hello


I'm trying to set the DataMappingType of columns on a typed dataset that I have
created using the DataSet designer in visual studio 2005, is there a way that I
can set the DataMappingType of the columns? I've tried editing the code that it
generates but any changes I make are overwritten if I open the design view, the
method that sets the DataMappingType is called InitClass and is private to each
DataTable

what can I do?

Alex


 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      04-10-2006
Hi Alex,

Thank you for posting.

As for the DataSet and its associated component classes, it is actually
generated according to the DataSet.xsd (xml schema) file. So IMO, if we
need to change the mapped datatype in our typedDataSet, we need to change
the type mapping info in the scheme file (xxxx.xsd). Based on my test, we
can change it through the below approachs:

1. Directly open the XSD file through xml editor or text editor,

<xs:element name="price" msprop:Generator_UserColumnName="price"
msprop:Generator_ColumnPropNameInRow="price"
msprop:Generator_ColumnVarNameInTable="columnprice "
msprop:Generator_ColumnPropNameInTable="priceColum n" type="xs:short" />

note the type="xs:short" is the type mapping.


2. Also, in VS IDE, in design-view, when select the typed DataSet's
certain column, in the property grid, you can find the "Data Type" property
which can be modifed also.

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



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











 
Reply With Quote
 
 
 
 
Alexander Walker
Guest
Posts: n/a
 
      04-16-2006
Hello Steven

Thank you for replying to my query

Unfortunately I did not word the question correctly

I do not want to change the DataType of a column

I wanted to change the MappingType
http://msdn.microsoft.com/library/de...classtopic.asp

The DataSet designer sets the MappingType as MappingType.Element, I want to set
the MappingType as MappingType.Attribute

How do I do this?

Alex


 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      04-17-2006
Thank you for the response Alex,

So I got that what you want to do is change the typed DAtaSet's DataTable
Column's xml representation mapping (XmlElement or Attribute), correct? If
so, I'm afraid this is not quite simple to do. Actually, the DataSet's
generation process is on the contrary as what want to do here. The DataSet
class(designer generated code) is generated according to the xsd file(xml),
so this determines whether it use XMLElement or XmlAttributre for the table
column in XML represenation. However, for typed dataset, designer always
create the XML schema (xsd) and use XmlElement for table columns. (it use
attributes for untyped dataset), so there is not such setting on code or
DataSet after the xsd is created(which is at the very begining of hte
dataset generation).

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.


 
Reply With Quote
 
Alexander Walker
Guest
Posts: n/a
 
      05-07-2006
Hello Steven

Thanks for letting me know.

Might there be any improvements to the Dataset designer in the future that would
allow control over whether an XmlElement or an XmlAttribute is generated for a
column?

Is there any way that I could use the extensibility features of Visual Studio to
enable this functionality in the current version?

Alex


 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      05-08-2006
Thanks for your followup Alex,

So far I haven't found any existing add-in or utility for vs 2005 that
could do this setting. I think this will require a new custom tool
component be built for this functionality. Anyway, I suggest you submit
this request to the MSDN product feedback center so that our dev team can
also see such comments. Your feedback is really appreciated

http://lab.msdn.microsoft.com/produc...k/default.aspx

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



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

 
Reply With Quote
 
Alexander Walker
Guest
Posts: n/a
 
      05-08-2006
I had a look at the suggestions on the MSDN Product Feedback Center and I found
this suggestion

http://lab.msdn.microsoft.com/produc...6-cca8d9156903

Its exactly the same issue that I'm having, I have voted for it and I think it
should be included in a future release of Visual Studio

Alex


 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      05-09-2006
That's fine. Thanks for your followup Alex,

And please always feel free to post here when there is anything we can help
you.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Designer Property Serialization -- Sycning inner properties to designer property window Alexander Higgins ASP .Net Building Controls 3 07-30-2007 09:09 PM
Designer Property Serialization -- Sycning inner properties to designer property window Alexander Higgins ASP .Net Web Controls 0 07-21-2007 12:58 AM
Sharepoint Designer/ Expression Web Designer : adding item in toolbox ? Steve B. ASP .Net 4 06-01-2007 04:29 AM
Dataset designer and multiple resultsets from stored proc John Dalberg ASP .Net 0 03-23-2006 11:02 PM
How to update dataset from database automatically via Visual Data Designer GS ASP .Net 1 01-19-2006 03:02 PM



Advertisments