SQL Server 2000 simplified and Complex Conversion of Chinese character data (COM,. Net)
First, make sure that. Net Framework 1.1 is installed on Windows (of course only the SQL Server!
After successful installation:
1. Use sn-k to create a strong-name key file for the Class Library:
Run the following command line in the v1.1Bin subdirectory of the directory where Microsoft. Net Framework SDK is installed:
Sn.exe-k c: snkey. snk
2.open the notepad (notepad.exe) and write the following C # program and save it as a C: Microshaoft. cs file:
Using System;
Using System. Runtime. InteropServices;
Using System. Reflection;
Using System. Runtime. CompilerServices;
[Assembly: AssemblyKeyFile ("snKey. snk")]
Namespace Microshaoft
{
Public interface IStrings
{
String StringConvert (string x );
}
[ClassInterface (ClassInterfaceType. AutoDual)]
Public class Strings: IStrings
{
Public string StringConvert (string x)
{
Return Microsoft. VisualBasic. Strings. StrConv (x, Microsoft. VisualBasic. VbStrConv. TraditionalChinese, System. Globalization. CultureInfo. CurrentCulture. LCID );
/// Simple conversion can also be added with StringConvert parameter control.
}
}
}
3. Run cmd in Windows to go to the command line console and execute the following command line:
C: WINDOWSMicrosoft.NETFrameworkv1.1.4322csc.exe/t: library/out: C: Microshaoft. dll C: Microshaoft. cs/r: C: WINDOWSMicrosoft. NETFrameworkv1.1.4322Microsoft. VisualBasic. dll
If any error occurs, refer to csc.exe /? Help, or MSDN correction!
After you confirm the correct execution, the C: Microshaoft. dll file will be generated in this example!
4. Execute the following command line:
C: WINDOWSMicrosoft.NETFrameworkv1.1.4322egasm.exe c: microshaoft. dll/tlb: microshaoft. tlb/codebase