index > .NET Framework Data Access and Storage > How to retrieve value from UDT column written using CLR Integrati...

How to retrieve value from UDT column written using CLR Integrati...

Hi there,

Any knows? I have created my own User Defined Type in SQL Server. I wrote it using C#, compiled to DLL, and registered on SQL Server 2005. I created a table that uses this UDT.

Now I want to select from that table using DataAdaptor and Dataset. How should I define the column type in DataSet? How can I use this UDT type to "SqlCommand.Paramater.Add" so that it will fill the DataSet for me?

Thanks very much!!!




To be an expert one day!!!
Pi314159
Should just be varchar or nvarchar - all .NET UDTs have method to convert to/from strings for this purpose.
Greg Beech

The column type is the type of the UDT (such as Point).

SqlParameter can handle UDT value, what you need to do is to specify the SqlDbType as Udt and provide UdtTypename.

SqlParameter param = cmd.Parameters.Add("@p", SqlDbType.Udt);
param.UdtTypeName = "dbo.Point";




This posting is provided "AS IS" with no warranties, and confers no rights.
Bill Lin - MSFT
reply 3

You can use google to search for other answers

 

More Articles

• Performance question with DataReader
• access sql server database with vb
• Test if a MDB is Corrupted
• Navigating Large Database
• Application Blocks
• Read-only database problem after site installation
• Getting deleted child rows for a "SINGLE" parent row
• Computed Columns in TableAdapters
• Changes made to multiple tables
• Transaction
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• database diagram node in server explorer
• Typed Dataset Question #2
• getting info from database
• Urgent! Pls answer me. Database.
• Retrieving CLOB data from Informix
• Stored Procedures takes long time to exe
• Tableadapter Update
• What am I doing wrong?
• Merging two datatables with different co
• Repeating name in namespace + classname,
• Error generating a DataSet from an Oracl
• Dropdownlist Binding
• DataType Yes/No
• Trying to insert non-latin characters in
• How to synchronize XML file with DataSet

Hot Articles

• Query about DataSet
• OCI-22053: overflow error caused when re
• What is the maximum number of tables in
• ADO Recordset Getting Closed in C#
• how to modify and upadate the data in da
• Save and retrieve RTF Text from MSSQL DB
• Advice needed - persist data during a se
• Data Access Page
• How to call a aspx page from a exe file
• Personalization & Integrated Security
• The provider could not determine the Dec
• SQLBulkCopy and text files.
• ComputerEase ODBC Date Insert/Update pro
• How to get the max length of text field
• how to create .xml file using SQL query

Recommend Articles

• Combo Boxes and RecordSet
• What is the List<OdbcParameter>.En
• Build connection string like COM?
• Visual Studio 2003.net Databases Connect
• subquery doesn't work (using VC#, *.csv,
• questions about Automatically Generating
• Changing the database asociated with a D
• Generating DataSet Relations from XML Sc
• Expression Building - Access 2003
• Changes made to multiple tables
• Using classic ADO parameter objects from
• URGENT Problem with Greek Character from
• poor oracleclient performance (System.Da
• how to use where clause in data adapter
• Any way to display images in gridview?