Like "int" refers to "Int32" class, "string" refers to "String" class. How to refer a datatype like "abc" to my "Abc" class?
You can create a new class which has specific fields. If you need exact size of fields you can use byte arrays. class Data { public byte[] dataA = new byte[1]; public byte[] dataB = new byte[2]; public byte[] dataC = new byte[7]; ... }
To create a user-defined data type. In Object Explorer, expand Databases, expand a database, expand Programmability, expand Types, right-click User-Defined Data Types, and then click New User-Defined Data Type.
ANSI C provides three types of data types: Primary(Built-in) Data Types: void , int , char , double , and float . Derived Data Types: Array, References, and Pointers. User Defined Data Types: Structure, Union, and Enumeration.
Your "class" is a data type.
The examples you give are the difference between CLR data type names and C# datatype names. They are aliases. C# int maps to CLR Int32 and C# string maps to CLR String.
You can create your own aliases by using "using Xyx=Abc". You must do this in each source file, so it is not that useful.
You can add an alias like this:
using abc = MyNamespace.Abc;
But I would question why you would want to do this.
[Another poster pointed out a valid use, namely namespace type clashes, but then I would always use the fully qualified type name otherwise it might get very confusing.]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With