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)); }
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).Substring(0, actualLength)); }
internal static extern OdbcReturn SQLGetInfo ( IntPtr connHandle, OdbcInfo info, byte [] buffer, short buffLength, ref short remainingStrLen);
internal static extern OdbcReturn SQLGetInfo( IntPtr connHandle, OdbcInfo info, byte [] buffer, short buffLength, ref short remainingStrLen);
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); }
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); }