internal string GetNlsInfo(OciHandle handle, uint bufflen, OciNlsServiceType item)
        {
            byte[] buffer = new Byte[bufflen];

            OciCalls.OCINlsGetInfo(handle, ErrorHandle,
                                   ref buffer, bufflen, (ushort)item);

            // Get length of returned string
            int rsize = 0;

            OciCalls.OCICharSetToUnicode(Environment, null, buffer, out rsize);

            // Get string
            StringBuilder ret = new StringBuilder(rsize);

            OciCalls.OCICharSetToUnicode(Environment, ret, buffer, out rsize);

            return(ret.ToString());
        }
Example #2
0
		// Get NLS Info
		//
		// handle = OciEnvironmentHandle or OciSessionHandle
		// bufflen = Length of byte buffer to allocate to retrieve the NLS info
		// item = OciNlsServiceType enum value
		//
		// if unsure how much you need, use OciNlsServiceType.MAXBUFSZ
		internal string GetNlsInfo (OciHandle handle, uint bufflen, OciNlsServiceType item)
		{
			byte[] buffer = new Byte[bufflen];

			OciCalls.OCINlsGetInfo (handle, ErrorHandle, 
				ref buffer, bufflen, (ushort) item);

			// Get length of returned string
			ulong rsize = 0;
			UIntPtr rsizep = new UIntPtr (rsize);
			OciCalls.OCICharSetToUnicode (Environment, null, buffer, ref rsizep);
			
			// Get string
			rsize = rsizep.ToUInt64 ();
			StringBuilder ret = new StringBuilder ((int)rsize);
			OciCalls.OCICharSetToUnicode (Environment, ret, buffer, ref rsizep);

			return ret.ToString ();
		}