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


C# System.Data.SQLite.SQLiteConnection.Dispose方法代码示例

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


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

示例1: UpdateDatabaseWithArteProps

        public void UpdateDatabaseWithArteProps( string ConnectionString )
        {
            System.Data.SQLite.SQLiteConnection conn = new System.Data.SQLite.SQLiteConnection( ConnectionString );
            conn.Open();
            System.Data.SQLite.SQLiteTransaction transaction = conn.BeginTransaction();
            System.Data.SQLite.SQLiteCommand command = new System.Data.SQLite.SQLiteCommand( conn );
            command.Transaction = transaction;
            foreach ( var a in ArteList ) {
                string UpdateNames = "UPDATE Text SET IdentifyString = \"" + a.Type.ToString() + ";\" || IdentifyString WHERE IdentifyString LIKE \"%[" + a.NameStringDicId + " / 0x" + a.NameStringDicId.ToString( "X6" ) + "]\"";
                Console.WriteLine( UpdateNames );
                command.CommandText = UpdateNames;
                command.ExecuteNonQuery();
                string UpdateDescs = "UPDATE Text SET IdentifyString = \"Description;\" || IdentifyString WHERE IdentifyString LIKE \"%[" + a.DescStringDicId + " / 0x" + a.DescStringDicId.ToString( "X6" ) + "]\"";
                Console.WriteLine( UpdateDescs );
                command.CommandText = UpdateDescs;
                command.ExecuteNonQuery();

                if ( a.Type == Arte.ArteType.Generic ) {
                    string UpdateStatus = "UPDATE Text SET status = 4, updated = 1, updatedby = \"[HyoutaTools]\", updatedtimestamp = " + Util.DateTimeToUnixTime( DateTime.UtcNow ) + " WHERE IdentifyString LIKE \"%[" + a.NameStringDicId + " / 0x" + a.NameStringDicId.ToString( "X6" ) + "]\"";
                    Console.WriteLine( UpdateStatus );
                    command.CommandText = UpdateStatus;
                    command.ExecuteNonQuery();
                }
            }
            command.Dispose();
            transaction.Commit();
            conn.Close();
            conn.Dispose();
        }
开发者ID:AdmiralCurtiss,项目名称:HyoutaTools,代码行数:29,代码来源:T8BTMA.cs

示例2: TestCaseSensitiveKeyColumn

        public void TestCaseSensitiveKeyColumn()
        {
            var path = Path.GetTempFileName();
            try
            {
                var sqlite = new System.Data.SQLite.SQLiteConnection("Data Source=" + path);
                sqlite.Open();
                var cmd = sqlite.CreateCommand();
                cmd.CommandText = "create table test(col_ID integer primary key, name text, shape blob)";
                cmd.ExecuteNonQuery();
                cmd.Dispose();
                sqlite.Close();
                sqlite.Dispose();
                using (var sq = new ManagedSpatiaLite("Data Source=" + path, "test", "shape", "COL_ID"))
                {
                    var ext = new Envelope();
                    var ds = new SharpMap.Data.FeatureDataSet();
                    sq.ExecuteIntersectionQuery(ext, ds);
                    NUnit.Framework.Assert.AreEqual(0, ds.Tables[0].Count);
                }

            }
            catch (Exception ex)
            {
                Assert.Fail("Got exception, should not happen");

            }
            finally
            {
                File.Delete(path);
            }
        }
开发者ID:geobabbler,项目名称:SharpMap,代码行数:32,代码来源:ManagedSQLiteTests.cs

示例3: ApplicationWebService

        // "x:\util\android-sdk-windows\platform-tools\adb.exe"  tcpip 5555
        // restarting in TCP mode port: 5555

        // "x:\util\android-sdk-windows\platform-tools\adb.exe" connect 192.168.1.126:5555
        // connected to 192.168.1.126:5555

        static ApplicationWebService()
        {
            // will this work for android?

            Console.WriteLine("ApplicationWebService cctor " + new { Environment.CurrentDirectory });

            // ApplicationWebService cctor { CurrentDirectory = W:\staging.net.debug }

            #region setup:QueryExpressionBuilder.WithConnection
            //if (ScriptCoreLib.Query.Experimental.QueryExpressionBuilder.WithConnection == null)

            // override the default
            ScriptCoreLib.Query.Experimental.QueryExpressionBuilder.WithConnection =
                y =>
                {
                    // relative path?
                    var DataSource = "file:server1.sqlite";

                    // nuget xsqlite?
                    var cc = new System.Data.SQLite.SQLiteConnection(new System.Data.SQLite.SQLiteConnectionStringBuilder
                    {
                        DataSource = DataSource,
                        Version = 3
                    }.ConnectionString);
                    cc.Open();
                    y(cc);
                    cc.Dispose();
                };
            #endregion
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:36,代码来源:ApplicationWebService.cs

示例4: Main

        public static void Main(string[] args)
        {
            // detect debugger as 2015community?
            // Managed Compatibility Mode does not support Edit and Continue

            // lets do a headless simulation.

            #region setup:QueryExpressionBuilder.WithConnection
            ScriptCoreLib.Query.Experimental.QueryExpressionBuilder.WithConnection =
                y =>
                {
                    // relative path?
                    var DataSource = "file:debugger1.sqlite";

                    // nuget xsqlite?
                    var cc = new System.Data.SQLite.SQLiteConnection(new System.Data.SQLite.SQLiteConnectionStringBuilder
                    {
                        DataSource = DataSource,
                        Version = 3
                    }.ConnectionString);
                    cc.Open();
                    y(cc);
                    cc.Dispose();
                };
            #endregion



            // https://github.com/dotnet/roslyn/wiki/EnC-Supported-Edits
            // http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/6015600-edit-continue-in-async-methods
            // Edit & Continue is one of the best feature of vs bringing huge productivity gain, unfortunatly Edit & Continue does not work in Async methods.



            new Action(new Program().EditAndContinue).InvokeAndReinvokeIfCodeModified();
            //xDebugger.InvokeAndReinvokeIfCodeModified(EditAndContinue);


            RewriteToUltraApplication.AsProgram.Launch(typeof(Application));
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:40,代码来源:Program.cs


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