GetInt16() public méthode

Returns the column as a short
public GetInt16 ( int i ) : Int16
i int The index of the column to retrieve
Résultat System.Int16
Exemple #1
0
 static int GetInt16(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Mono.Data.Sqlite.SqliteDataReader obj = (Mono.Data.Sqlite.SqliteDataReader)ToLua.CheckObject(L, 1, typeof(Mono.Data.Sqlite.SqliteDataReader));
         int   arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         short o    = obj.GetInt16(arg0);
         LuaDLL.lua_pushnumber(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
        public override int checkOutTimedetailID(string name, string starttime)
        {
            try {
                sqlite_cmd = sqlite_conn.CreateCommand ();
                sqlite_cmd.CommandText = "SELECT id FROM tbl_timedetail WHERE name ='"+name+"' AND starttime='"+starttime+"'";
                sqlite_conn.Open ();
                datareader = sqlite_cmd.ExecuteReader ();

                int readID = 0;

                while (datareader.Read())
                {
                    readID = datareader.GetInt16(0);
                }
                sqlite_conn.Close ();
                return readID;
            }
            catch (Exception ex)
            {
                sqlite_conn.Close ();
                return 0;
            }
        }
        public override int readWorkerID(string fname, string lname, string village, string hnr, string email)
        {
            try {
                sqlite_cmd = sqlite_conn.CreateCommand ();
                sqlite_cmd.CommandText = "SELECT id FROM tbl_worker WHERE fname= '"+fname+"' AND lname= '"+lname+"'AND village= '"+village+"' AND hnr= '"+hnr+"' AND email= '"+email+"'";
                sqlite_conn.Open ();
                datareader = sqlite_cmd.ExecuteReader ();

                int readID = 0;

                while (datareader.Read())
                {
                    readID = datareader.GetInt16(0);
                }
                sqlite_conn.Close ();
                return readID;
            }
            catch (Exception ex)
            {
                sqlite_conn.Close ();
                return 0;
            }
        }
        public override int readWorkplaceID(int fk_area, int fk_task, int fk_typ)
        {
            try {
                sqlite_cmd = sqlite_conn.CreateCommand ();
                sqlite_cmd.CommandText = "SELECT id FROM tbl_workplace WHERE fk_area = "+fk_area+" AND fk_task = "+fk_task+" AND fk_typ = "+fk_typ+"";
                sqlite_conn.Open ();
                datareader = sqlite_cmd.ExecuteReader ();

                int readID = 0;

                while (datareader.Read())
                {
                    readID = datareader.GetInt16(0);
                }
                sqlite_conn.Close ();
                return readID;
            }
            catch (Exception ex)
            {
                sqlite_conn.Close ();
                return 0;
            }
        }
        public override int readAreaID(string area)
        {
            try {

                sqlite_cmd = sqlite_conn.CreateCommand ();

                sqlite_cmd.CommandText = "SELECT id FROM tbl_area WHERE name= '"+area+"'";

                sqlite_conn.Open ();

                datareader = sqlite_cmd.ExecuteReader ();

                int readID = 0;

                while (datareader.Read())
                {
                    readID = datareader.GetInt16(0);
                }
                sqlite_conn.Close ();
                return readID;
            }
            catch (Exception ex)
            {
                sqlite_conn.Close ();
                return 0;
            }
        }