public HowTo_Execute_SQLFunction() { //<document> long _iduser = 0L; OGen.lib.datalayer.DBConnection _con = OGen.lib.datalayer.DBConnectionsupport.CreateInstance( // set your db server type here OGen.lib.datalayer.DBServerTypes.PostgreSQL, // and connectionstring "Server=127.0.0.1;Port=5432;User ID=postgres;Password=passpub;Database=OGen-NTier_UTs;" ); // set your function parameters System.Data.IDbDataParameter[] _dataparameters = new System.Data.IDbDataParameter[] { _con.newDBDataParameter( "IDUser_", System.Data.DbType.Int64, System.Data.ParameterDirection.Input, _iduser, 0 ) }; // call you function _con.Execute_SQLFunction( "sp0_User_delObject", _dataparameters ); _con.Dispose(); _con = null; //</document> }
public HowTo_Execute_SQLFunction_returnDataTable() { //<document> long _idgroup_search = 1L; OGen.lib.datalayer.DBConnection _con = OGen.lib.datalayer.DBConnectionsupport.CreateInstance( // set your db server type here OGen.lib.datalayer.DBServerTypes.PostgreSQL, // and connectionstring "Server=127.0.0.1;Port=5432;User ID=postgres;Password=passpub;Database=OGen-NTier_UTs;" ); // set your function parameters System.Data.IDbDataParameter[] _dataparameters = new System.Data.IDbDataParameter[] { _con.newDBDataParameter( "IDGroup_search_", System.Data.DbType.Int64, System.Data.ParameterDirection.Input, _idgroup_search, 0 ) }; // you now have a DataTable populated // with results from your sql function System.Data.DataTable _datatable = _con.Execute_SQLFunction_returnDataTable( "sp0_User_Record_open_byGroup_fullmode", _dataparameters ); _con.Dispose(); _con = null; //</document> }
public HowTo_Execute_SQLFunction_returnSomevalue() { //<document> long _iduser = 0L; OGen.lib.datalayer.DBConnection _con = OGen.lib.datalayer.DBConnectionsupport.CreateInstance( // set your db server type here OGen.lib.datalayer.DBServerTypes.PostgreSQL, // and connectionstring "Server=127.0.0.1;Port=5432;User ID=postgres;Password=passpub;Database=OGen-NTier_UTs;" ); // set your function parameters System.Data.IDbDataParameter[] _dataparameters = new System.Data.IDbDataParameter[] { _con.newDBDataParameter( "IDUser_", System.Data.DbType.Int64, System.Data.ParameterDirection.Input, _iduser, 0 ) }; // call you function and get returning value bool _result = (bool)_con.Execute_SQLFunction( "fnc0_User_isObject", _dataparameters, System.Data.DbType.Boolean, // returning value db type 0 // returning value size, if applicable ); _con.Dispose(); _con = null; //</document> }