当前位置: 首页>>代码示例>>C#>>正文


C# Utils.ExecuteNonQuery方法代码示例

本文整理汇总了C#中System.Utils.ExecuteNonQuery方法的典型用法代码示例。如果您正苦于以下问题:C# Utils.ExecuteNonQuery方法的具体用法?C# Utils.ExecuteNonQuery怎么用?C# Utils.ExecuteNonQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Utils的用法示例。


在下文中一共展示了Utils.ExecuteNonQuery方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: initDatabase

 private void initDatabase(Utils.DBCon dbcon)
 {
     object o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='preset'");
     if (o == null || o.GetType() == typeof(DBNull))
     {
         dbcon.ExecuteNonQuery("create table 'preset' (name text)");
     }
     o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='forms'");
     if (o == null || o.GetType() == typeof(DBNull))
     {
         dbcon.ExecuteNonQuery("create table 'forms' (preset text, plugintype text, x integer, y integer, w integer, h integer, visible integer, customtag text)");
     }
     else if (!dbcon.ColumnExists("forms", "customtag"))
     {
         dbcon.ExecuteNonQuery("alter table 'forms' add customtag text");
     }
 }
开发者ID:RH-Code,项目名称:GAPP,代码行数:17,代码来源:Presets.cs

示例2: initDatabase

 private void initDatabase(Utils.DBCon dbcon)
 {
     object o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='shortcut'");
     if (o == null || o.GetType() == typeof(DBNull))
     {
         dbcon.ExecuteNonQuery("create table 'shortcut' (plugintype text, action text, subaction text, keys integer, keystring text)");
     }
 }
开发者ID:RH-Code,项目名称:GAPP,代码行数:8,代码来源:ShortcutsSetup.cs

示例3: InitDatabase

        public bool InitDatabase(Utils.DBCon dbcon)
        {
            /*
             * database:
             * areainfo -> id, parentid, level, name, minlat, minlon, maxlat, maxlon
             * poly -> id, areainfoid, position, lat, lon
             */
            bool result = false;
            try
            {
                object o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='areainfo'");
                if (o == null || o.GetType() == typeof(DBNull))
                {
                    dbcon.ExecuteNonQuery("create table 'areainfo' (id integer, parentid integer, level integer, name text, minlat real, minlon real, maxlat real, maxlon real)");
                }

                o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='poly'");
                if (o == null || o.GetType() == typeof(DBNull))
                {
                    dbcon.ExecuteNonQuery("create table 'poly' (id integer, areainfoid integer, position integer, lat real, lon real)");
                    dbcon.ExecuteNonQuery("create index idx_poly on poly (areainfoid)");
                }

                result = true;
            }
            catch
            {
            }
            return result;
        }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:30,代码来源:AreasPlugin.cs

示例4: initDatabase

 private void initDatabase(Utils.DBCon dbcon)
 {
     object o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='groups'");
     if (o == null || o.GetType() == typeof(DBNull))
     {
         dbcon.ExecuteNonQuery("create table 'groups' (id integer, name text)");
     }
     o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='images'");
     if (o == null || o.GetType() == typeof(DBNull))
     {
         dbcon.ExecuteNonQuery("create table 'images' (url text, imagedata blob)");
     }
     o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='trackables'");
     if (o == null || o.GetType() == typeof(DBNull))
     {
         dbcon.ExecuteNonQuery("create table 'trackables' (groupid integer, AllowedToBeCollected integer, Archived integer, BugTypeID integer, Code text, CurrentGeocacheCode text, CurrentGoal text, DateCreated text, Description text, IconUrl text, Id integer, InCollection integer, Name text, TBTypeName text, Url text, WptTypeID integer, Owner text, HopCount integer, DiscoverCount integer, InCacheCount integer, DistanceKm real, Lat real, Lon real)");
         dbcon.ExecuteNonQuery("create index idx_trackablesgroup on trackables (groupid)");
         dbcon.ExecuteNonQuery("create index idx_trackablescode on trackables (code)");
     }
     o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='travels'");
     if (o == null || o.GetType() == typeof(DBNull))
     {
         dbcon.ExecuteNonQuery("create table 'travels' (pos integer, TrackableCode text, GeocacheCode text, lat real, lon real, DateLogged text)");
         dbcon.ExecuteNonQuery("create index idx_travels on travels (TrackableCode)");
     }
     o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='logs'");
     if (o == null || o.GetType() == typeof(DBNull))
     {
         dbcon.ExecuteNonQuery("create table 'logs' (TrackableCode text, ID integer, LogCode text, GeocacheCode text, IsArchived integer, LoggedBy text, LogGuid text, LogIsEncoded integer, LogText text, WptLogTypeId integer, Url text, UTCCreateDate text, VisitDate text)");
         dbcon.ExecuteNonQuery("create index idx_logstb on logs (TrackableCode)");
         dbcon.ExecuteNonQuery("create index idx_logsid on logs (ID)");
     }
 }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:33,代码来源:TrackableGroupsForm.cs

示例5: initDatabase

 private void initDatabase(Utils.DBCon dbcon)
 {
     object o = dbcon.ExecuteScalar("SELECT name FROM sqlite_master WHERE type='table' AND name='processedpq'");
     if (o == null || o.GetType() == typeof(DBNull))
     {
         dbcon.ExecuteNonQuery("create table 'processedpq' (pqname text, processdate text)");
     }
 }
开发者ID:RH-Code,项目名称:GAPP,代码行数:8,代码来源:ImportPQ.cs


注:本文中的System.Utils.ExecuteNonQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。