随笔 - 102  文章 - 25 评论 - 2395 trackbacks - 29

.net asp web c# vb VS2005 VS2008 VS2003

    姓名 景春雷
    网名 1-2-3
    生日 1980.2.29
    城市 沈阳

最近在读的书
同事的创业网站
指甲油
汽车用品

昵称:1-2-3
园龄:4年5个月
荣誉:推荐博客
粉丝:150
关注:25

搜索

 

常用链接

我的标签

随笔分类(110)

随笔档案(108)

文章分类(24)

相册

积分与排名

  • 积分 - 379139
  • 排名 - 168

最新评论

阅读排行榜

评论排行榜

推荐排行榜

# Windows Data Type .NET Data Type

# BOOL, BOOLEAN Boolean or Int32

# BSTR String

# BYTE Byte

# CHAR Char

# DOUBLE Double

# DWORD Int32 or UInt32

# FLOAT Single

# HANDLE (and all other handle types, such as HFONT and HMENU) IntPtr, UintPtr or HandleRef

# HRESULT Int32 or UInt32

# INT Int32

# LANGID Int16 or UInt16

# LCID Int32 or UInt32

# LONG Int32

# LPARAM IntPtr, UintPtr or Object

# LPCSTR String

# LPCTSTR String

# LPCWSTR String

# LPSTR String or StringBuilder*

# LPTSTR String or StringBuilder

# LPWSTR String or StringBuilder

# LPVOID IntPtr, UintPtr or Object

# LRESULT IntPtr

# SAFEARRAY .NET array type

# SHORT Int16

# TCHAR Char

# UCHAR SByte

# UINT Int32 or UInt32

# ULONG Int32 or UInt32

# VARIANT Object

# VARIANT_BOOL Boolean

# WCHAR Char

# WORD Int16 or UInt16

# WPARAM IntPtr, UintPtr or Object

# 另: 在进行string转换时,需要加入前缀[MarshalAs(UnmanagedType.LPStr)]lpdword 对应于 ref int

#

#

# C/C++ C#

# HANDLE, LPDWORD, LPVOID, void* IntPtr

# LPCTSTR, LPCTSTR, LPSTR, char*, const char*, Wchar_t*, LPWSTR String [in], StringBuilder [in, out]

# DWORD, unsigned long, Ulong UInt32, [MarshalAs(UnmanagedType.U4)]

# bool bool

# LP<struct> [In] ref <struct>

# SIZE_T uint

# LPDWORD out uint

# LPTSTR [Out] StringBuilder

# PULARGE_INTEGER out ulong

# WORD uInt16

# Byte, unsigned char byte

# Short Int16

# Long, int Int32

# float single

# double double

# NULL pointer IntPtr.Zero

# Uint Uint32

#

# C#调用DLL文件时参数对应表

# Wtypes.h中哋非托管类型 非托管 C语言類型 托管类名 説明

# HANDLE void* System.IntPtr 32 莅

# BYTE unsigned char System.Byte 8 位

# SHORT short System.Int16 16 位

# WORD unsigned short System.UInt16 16 位

# INT int System.Int32 32 位

# UINT unsigned int System.UInt32 32 位

# LONG long System.Int32 32 位

# BOOL long System.Int32 32 位

# DWORD unsigned long System.UInt32 32 位

# ULONG unsigned long System.UInt32 32 位

# CHAR char System.Char 用 ANSI 修饰。

# LPSTR char* System.String 或 System.StringBuilder 用 ANSI 修饰。

# LPCSTR Const char* System.String 或System.StringBuilder 用 ANSI 修飾。

# LPWSTR wchar_t* System.String 或System.StringBuilder 用 Unicode 修饰。

# LPCWSTR Const wchar_t* System.String 或System.StringBuilder 用 Unicode 修饰。

# FLOAT Float System.Single 32 位

# DOUBLE Double System.Double 64 位

#

# 习惯用C#写东西,但平时又会碰到很多要用win32 API哋哋汸,所以经常要用DllImport,但win32函数的类型写法是很庞杂的,相信潙之困扰的芣止我一个,现在我整理一份我个人的理解如下,希望滈人不吝赐教。

# 我的基本原则有如下凢点:

# 1、下面都是针对32位系统的,葰以int是32位.long也是32位;

# 2、各种句柄类的(H开头),我认为一律湜System.IntPtr,到目湔为止没发现出错;如果哪位在使用中出错,请指炪;

# 3、LP和P,我实茬不懂(对C 不忲了解),对于LP和P开头的函薮,如果湜和STR有关的,一律写潙System.String,潒PLCID这样指向什么东西哋,写为System.UInt32(因为指向另一个地址,那就湜指针,指针是32位吧),int之类的数值型,那我就写为int[],以方便.net程序引用(写成System.UInt32的话,给API调用应该也芣会出错,但.net程序僦不好引用了)

# 如有意见,欢迎指教。谢谢

# BOOL=System.Int32

# BOOLEAN=System.Int32

# BYTE=System.UInt16

# CHAR=System.Int16

# COLORREF=System.UInt32

# DWORD=System.UInt32

# DWORD32=System.UInt32

# DWORD64=System.UInt64

# FLOAT=System.Float

# HACCEL=System.IntPtr

# HANDLE=System.IntPtr

# HBITMAP=System.IntPtr

# HBRUSH=System.IntPtr

# HCONV=System.IntPtr

# HCONVLIST=System.IntPtr

# HCURSOR=System.IntPtr

# HDC=System.IntPtr

# HDDEDATA=System.IntPtr

# HDESK=System.IntPtr

# HDrop=System.IntPtr

# HDWP=System.IntPtr

# HENHMETAFILE=System.IntPtr

# HFILE=System.IntPtr

# HFONT=System.IntPtr

# HGDIOBJ=System.IntPtr

# HGLOBAL=System.IntPtr

# HHOOK=System.IntPtr

# HICON=System.IntPtr

# HIMAGELIST=System.IntPtr

# HIMC=System.IntPtr

# HINSTANCE=System.IntPtr

# HKEY=System.IntPtr

# HLOCAL=System.IntPtr

# HMENU=System.IntPtr

# HMETAFILE=System.IntPtr

# HMODULE=System.IntPtr

# HMONITOR=System.IntPtr

# HPALETTE=System.IntPtr

# HPEN=System.IntPtr

# HRGN=System.IntPtr

# HRSRC=System.IntPtr

# HSZ=System.IntPtr

# HWINSTA=System.IntPtr

# HWND=System.IntPtr

# INT=System.Int32

# INT32=System.Int32

# INT64=System.Int64

# LONG=System.Int32

# LONG32=System.Int32

# LONG64=System.Int64

# LONGLONG=System.Int64

# LPARAM=System.IntPtr

# LPBOOL=System.Int16[]

# LPBYTE=System.UInt16[]

# LPCOLORREF=System.UInt32[]

# LPCSTR=System.String

# LPCTSTR=System.String

# LPCVOID=System.UInt32

# LPCWSTR=System.String

# LPDWORD=System.UInt32[]

# LPHANDLE=System.UInt32

# LPINT=System.Int32[]

# LPLONG=System.Int32[]

# LPSTR=System.String

# LPTSTR=System.String

# LPVOID=System.UInt32

# LPWORD=System.Int32[]

# LPWSTR=System.String

# LRESULT=System.IntPtr

# PBOOL=System.Int16[]

# PBOOLEAN=System.Int16[]

# PBYTE=System.UInt16[]

# PCHAR=System.Char[]

# PCSTR=System.String

# PCTSTR=System.String

# PCWCH=System.UInt32

# PCWSTR=System.UInt32

# PDWORD=System.Int32[]

# PFLOAT=System.Float[]

# PHANDLE=System.UInt32

# PHKEY=System.UInt32

# PINT=System.Int32[]

# PLCID=System.UInt32

# PLONG=System.Int32[]

# PLUID=System.UInt32

# PSHORT=System.Int16[]

# PSTR=System.String

# PTBYTE=System.Char[]

# PTCHAR=System.Char[]

# PTSTR=System.String

# PUCHAR=System.Char[]

# PUINT=System.UInt32[]

# PULONG=System.UInt32[]

# PUSHORT=System.UInt16[]

# PVOID=System.UInt32

# PWCHAR=System.Char[]

# PWORD=System.Int16[]

# PWSTR=System.String

# REGSAM=System.UInt32

# SC_HANDLE=System.IntPtr

# SC_LOCK=System.IntPtr

# SHORT=System.Int16

# SIZE_T=System.UInt32

# SSIZE_=System.UInt32

# TBYTE=System.Char

# TCHAR=System.Char

# UCHAR=System.

# Wtypes.h 中哋非托管类侀 非托管 C 语訁類型 托涫类名 说明

# HANDLE void* System.IntPtr 在 32 位 Windows 操作系统上为 32 位,在 64 莅 Windows 操作系统上为 64 位。

# BYTE unsigned char System.Byte 8 位

# SHORT short System.Int16 16 莅

# WORD unsigned short System.UInt16 16 位

# INT int System.Int32 32 位

# UINT unsigned int System.UInt32 32 位

# LONG long System.Int32 32 位

# BOOL long System.Int32 32 位

# DWORD unsigned long System.UInt32 32 位

# ULONG unsigned long System.UInt32 32 位

# CHAR char System.Char 用 ANSI 修飾。

# LPSTR char* System.String 或 System.Text.StringBuilder 用 ANSI 修饰。

# LPCSTR Const char* System.String 或 System.Text.StringBuilder 鼡 ANSI 俢饰。

# LPWSTR wchar_t* System.String 或 System.Text.StringBuilder 用 Unicode 修飾。

# LPCWSTR Const wchar_t* System.String 或 System.Text.StringBuilder 用 Unicode 修饰。

# FLOAT Float System.Single 32 位

# DOUBLE Double System.Double 64 位 ...-->

posted @ 2011-09-23 09:52 1-2-3 阅读(77) 评论(0)  编辑
      花几天学了下SVN,用XMind作的笔记。http://share.xmind.net/zahuifan/installation-configuration-svn-1/



posted @ 2009-04-21 11:13 1-2-3 阅读(266) 评论(2)  编辑
      突然之间,毫无征兆、莫名其妙地IOC就蹦出了个“已存在具有相同键的条目”的错误。
错误信息

可是配置文件里面明明没有重复的Id呀。经过1小时的排查,发现只要配置文件中的这个
<component
    id="Manager.HospPatientDrsAdvice"
    service="Dawn.HIS.Core.ManagerInterface.Hospitalized.IHospPatientDrsAdviceManager, Dawn.HIS.Core.ManagerInterface"
    type="Dawn.HIS.Core.BusinessManager.Hospitalized.HospPatientDrsAdviceManager, Dawn.HIS.Core.BusinessManager" />
标记注释掉就没问题了。可是这个标记还有用呀,然后发现只要把这个标记移到另一个我新添加的标记
<component
    id="Manager.PatientStateAdv"
    service="Dawn.HIS.Core.ManagerInterface.Hospitalized.IPatientStateAdvManager, Dawn.HIS.Core.ManagerInterface"
    type="Dawn.HIS.Core.BusinessManager.Hospitalized.PatientStateAdvManager, Dawn.HIS.Core.BusinessManager" />
的下面就没问题了。真是奇怪,难道标记的顺序也很重要?
      确实,HospPatientDrsAdviceManager类使用了IPatientStateAdvManager,难道如果必须按照引用顺序来排列标记的顺序?
posted @ 2009-04-10 09:21 1-2-3 阅读(459) 评论(0)  编辑
建立指向Oracle的连接

假设Oracle数据库的用户名为test,密码为test,在SQL Server数据库所在服务器上建立的指向Oracle数据库的服务命名为hisorcl.
1. 在SQL Server的企业管理器中的对象资源管理器中,展开“服务器对象”,在“链接服务器”上右击,选“新建链接服务器”。如下图所示进行配置。





通过连接查询Oracle数据库中的数据

select * from openquery(TEST_ORA, 'SELECT * FROM BASEMETADATA_DEPARTMENT')

使用下面的这个方法会报“……为列提供的元数据不一致……”的错误信息。

SELECT * FROM TEST_ORA..TEST.BASEMETADATA_DEPARTMENT

通过连接向Oracle中的表插入数据

INSERT OPENQUERY(TEST_ORA, 'select DepartmentId,DeptName,DeptCode from BaseMetaData_Department')
select DepartmentId,DeptName,DeptCode from BaseMetaData_Department

posted @ 2009-03-24 18:45 1-2-3 阅读(2750) 评论(1)  编辑
获取主键

select table_name,column_name
  
from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
 
where constraint_name not in (select constraint_name
                                 
from INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS)
 
order by table_name,column_name

获取自增列

select t.name TName, c.name ColName
  
from syscolumns c
  
left join sysobjects t
    
on c.id = t.id
  
left join systypes b on c.xusertype=b.xusertype   
 
where COLUMNPROPERTY(c.id,c.name,'IsIdentity')=1
 
order by t.name, c.name 

SQL Server 与 Oracle 对应的数据类型

首先选择“dbms”数据库。执行
select * from MSdatatype_mappings
 
where dbms_name = 'Oracle'

-- 或

select * from sysdatatypemappings
 
where destination_dbms = 'Oracle'
posted @ 2009-03-24 10:36 1-2-3 阅读(931) 评论(0)  编辑
posted @ 2009-03-12 17:49 1-2-3 阅读(445) 评论(0)  编辑
posted @ 2009-03-02 16:58 1-2-3 阅读(333) 评论(0)  编辑
posted @ 2008-10-08 09:04 1-2-3 阅读(301) 评论(0)  编辑
posted @ 2008-09-11 17:56 1-2-3 阅读(364) 评论(0)  编辑
posted @ 2008-08-11 14:45 1-2-3 阅读(722) 评论(0)  编辑
posted @ 2008-07-10 13:15 1-2-3 阅读(185) 评论(0)  编辑
posted @ 2008-07-07 10:15 1-2-3 阅读(276) 评论(0)  编辑
posted @ 2008-07-01 18:29 1-2-3 阅读(374) 评论(0)  编辑
posted @ 2008-06-16 12:55 1-2-3 阅读(2018) 评论(1)  编辑