Esempio n. 1
0
        string GetSafeInfo(OdbcInfo info)
        {
            if (State == ConnectionState.Closed)
            {
                return(null);
            }

            OdbcReturn ret        = OdbcReturn.Error;
            short      max_length = 512;

            byte [] buffer       = new byte [512];
            short   actualLength = 0;

            ret = libodbc.SQLGetInfo(hdbc, info, buffer, max_length, ref actualLength);
            if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
            {
                return(null);
            }
            return(Encoding.Unicode.GetString(buffer, 0, actualLength));
        }
Esempio n. 2
0
        internal string GetInfo(OdbcInfo info)
        {
            if (State == ConnectionState.Closed)
            {
                throw new InvalidOperationException("The connection is closed.");
            }

            OdbcReturn ret        = OdbcReturn.Error;
            short      max_length = 512;

            byte [] buffer       = new byte [512];
            short   actualLength = 0;

            ret = libodbc.SQLGetInfo(hdbc, info, buffer, max_length, ref actualLength);
            if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
            {
                throw CreateOdbcException(OdbcHandleType.Dbc, hdbc);
            }
            return(Encoding.Unicode.GetString(buffer, 0, actualLength));
        }
Esempio n. 3
0
        internal string GetInfo(OdbcInfo info)
        {
            if (State == ConnectionState.Closed)
            {
                throw new InvalidOperationException("The connection is closed.");
            }

            OdbcReturn ret        = OdbcReturn.Error;
            short      max_length = 256;

            byte [] buffer       = new byte [max_length];
            short   actualLength = 0;

            ret = libodbc.SQLGetInfo(hdbc, info, buffer, max_length, ref actualLength);
            if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
            {
                throw new OdbcException(new OdbcError("SQLGetInfo",
                                                      OdbcHandleType.Dbc,
                                                      hdbc));
            }

            return(System.Text.Encoding.Default.GetString(buffer).Substring(0, actualLength));
        }
Esempio n. 4
0
		internal static extern OdbcReturn SQLGetInfo (
			IntPtr connHandle,
			OdbcInfo info,
			byte [] buffer,
			short buffLength,
			ref short remainingStrLen);
Esempio n. 5
0
 internal static extern OdbcReturn SQLGetInfo(
     IntPtr connHandle,
     OdbcInfo info,
     byte [] buffer,
     short buffLength,
     ref short remainingStrLen);
Esempio n. 6
0
		string GetSafeInfo (OdbcInfo info)
		{
			if (State == ConnectionState.Closed)
				return null;

			OdbcReturn ret = OdbcReturn.Error;
			short max_length = 512;
			byte [] buffer = new byte [512];
			short actualLength = 0;

			ret = libodbc.SQLGetInfo (hdbc, info, buffer, max_length, ref actualLength);
			if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
				return null;
			return Encoding.Unicode.GetString (buffer, 0, actualLength);
		}
Esempio n. 7
0
		internal string GetInfo (OdbcInfo info)
		{
			if (State == ConnectionState.Closed)
				throw new InvalidOperationException ("The connection is closed.");

			OdbcReturn ret = OdbcReturn.Error;
			short max_length = 512;
			byte [] buffer = new byte [512];
			short actualLength = 0;

			ret = libodbc.SQLGetInfo (hdbc, info, buffer, max_length, ref actualLength);
			if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
				throw CreateOdbcException (OdbcHandleType.Dbc, hdbc);
			return Encoding.Unicode.GetString (buffer, 0, actualLength);
		}
                internal string GetInfo (OdbcInfo info)
                {
                        if (State == ConnectionState.Closed)
                                throw new InvalidOperationException ("The connection is closed.");
                        
                        OdbcReturn ret = OdbcReturn.Error;
                        short max_length = 256;
                        byte [] buffer = new byte [max_length];
                        short actualLength = 0;
                        
                        ret = libodbc.SQLGetInfo (hdbc, info, buffer, max_length, ref actualLength);
                        if (ret != OdbcReturn.Success && ret != OdbcReturn.SuccessWithInfo)
                                throw new OdbcException (new OdbcError ("SQLGetInfo",
                                                                        OdbcHandleType.Dbc,
                                                                        hdbc));

                        return System.Text.Encoding.Default.GetString (buffer);
                }