user-defined-types

How do you return a user defined type from a WCF service?

I have a WCF service hosted in IIS. The intention is for clients to make a call and receive a custom class that is defined in another project/dll. I have generated a service client using the svcutil.exe. The problem is this autogenerated client contains a new partial / proxy definition for the class I am trying to return from the service...

Lists in User Defined Types (SQL Server 2008)

I'm trying to define a new type and have not had much luck finding any information about using lists within them. Basically my new type will contain two lists, lets say x and y of type SqlSingle (the user defined type is written in C#) is this even possible? If not how are you supposed to go about simulating a two lists of an arbitary l...

create table based on a user defined type

Suppose I have a user defined type: CREATE OR REPLACE TYPE TEST_TYPE AS OBJECT ( f1 varchar2(10), f2 number(5) ); Now, I want to create a table to hold these types. I can do the following: create table test_type_table ( test_type_field test_type ); This gives me a table with one column, test_type_field. Is there an...

Using a user-defined type as a primary key

Suppose I have a system where I have metadata such as: table: ====== key name address ... Then suppose I have a user-defined type described as so: datasource datasource-key A) are there systems where it's possible to have keys based on user-defined types? B) if so, how do you decompose the keys into a form sui...

SQL Server 2008 - How do i return a User-Defined Table Type from a Table-Valued Function?

Here's my user-defined table type... CREATE TYPE [dbo].[FooType] AS TABLE( [Bar] [INT], ) This is what ive had to do in my table-valued function to return the type: CREATE FUNCTION [dbo].[GetFoos] RETURN @FooTypes TABLE ([Bar] [INT]) INSERT INTO @FooTypes (1) RETURN Basically, im having to re-declare my type definition in the RETU...

How does hierarchyid data type work?

I would like to make a CLR user-defined type in SQL Server 2005 that has the same performance benefits as hierarchyid to model hierarchies. Does anyone have any ideas/pointers? ...

Should small simple structs be passed by const reference?

I have always been taught that non-primitive types should be passed by const reference rather than by value where possible, ie: void foo(std::string str);//bad void foo(const std::string &str);//good But I was thinking today that maybe actually some simple user defined types may actually be better passed by value eg: class Vector2 { ...

Calling C DLL from Visual Basic 6: Double data type not working

I'm passing a simple user-defined type (UDT) from Visual Basic 6 to a C DLL. It works fine, except for the double data type, which shows up as 0. C DLL: #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdio.h> typedef struct _UserDefinedType { signed int Integer; unsigned char Byte; float Float...

Create a UDT that has SQL @tables as its members

I wonder whether it is possible to create a CLR user-defined type in SQL Server 2008 members of which would be table variables. You know, you can declare a table variable: declare @foo table (row_id int not null ... ); So I fancy a UDT with several members, each of which is a table defined that way (a different table, of course), so ...

ASMX Web Service - Return user defined class with properties

Hey, I am trying to return a user defined class from a web method. The class has properties and/or methods. Given the following web method: [WebMethod] public List<MenuItem> GetMenu() { List<MenuItem> menuItemList = new List<MenuItem>(); menuItemList.Add(new MenuItem()); menuItemList.Add(new MenuItem()); me...

Managing user-defined types across various modules

What is the best way to manage common user-defined types across VBA modules? I use the same user-defined types in different modules. For example, I often need to represent (x,y) points, so I end up having this Type in different modules: Type XYpointType x As Double y As Double End Type I pass arguments of type XYpointType to...

Is possible to get automatic cast from user-defined type to std::string using cout?

As in the question, if I define a string operator in my class: class Literal { operator string const () { return toStr (); }; string toStr () const; }; and then I use it: Literal l1 ("fa-2bd2bc3e0"); cout << (string)l1 << " Declared" << endl; with an explicit cast everything goes right, but if I remove the (string) the c...