{"id":70,"date":"2013-11-20T12:33:21","date_gmt":"2013-11-20T04:33:21","guid":{"rendered":"http:\/\/140.112.31.82\/wordpress\/?p=70"},"modified":"2013-11-20T12:33:21","modified_gmt":"2013-11-20T04:33:21","slug":"%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b","status":"publish","type":"post","link":"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b","title":{"rendered":"ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc"},"content":{"rendered":"<pre class=\"lang:default decode:true \" >        void showdata()\n        {\n        \/\/\u5efa\u7acb\u8cc7\u6599\u8868\n        SQLiteConnection conn = new SQLiteConnection(\"Data source=mydb.sqlite\");\n        \/\/ Open\n        conn.Open();\n        \/\/\u8981\u4e0b\u4efb\u4f55\u547d\u4ee4\u5148\u53d6\u5f97\u8a72\u9023\u7d50\u7684\u57f7\u884c\u547d\u4ee4\u7269\u4ef6\n        SQLiteCommand cmd = conn.CreateCommand();\n        \/\/ \u5efa\u7acb\u8cc7\u6599\u8868\n        cmd.Connection = conn;\n        cmd.CommandText = \"SELECT * FROM address_book\";\n        \/\/ \u57f7\u884c\u67e5\u8a62\u585e\u5165 sqlite_datareader\n        SQLiteDataReader sqlite_datareader = cmd.ExecuteReader();\n        GridView1.DataSource = sqlite_datareader;\n        GridView1.DataBind();\n        conn.Close();\n        }\n\n        void executeSQL(string sql)\n        {\n        SQLiteConnection conn = new SQLiteConnection(\"Data source=mydb.sqlite\");\n        conn.Open();\n        SQLiteCommand cmd = conn.CreateCommand();\n        cmd.Connection = conn;\n        cmd.CommandText = sql;\n        cmd.ExecuteNonQuery();\n        conn.Close();\n        }\n\n\n        protected void GridView1_RowEditing(Object sender, GridViewEditEventArgs e)\n        {\n            \/\/Set the edit index.\n            GridView1.EditIndex = e.NewEditIndex;\n            \/\/Bind data to the GridView control.\n            showdata();\n        }\n        protected void GridView1_OnRowCancelingEdit(Object sender, GridViewCancelEditEventArgs e)\n        {\n            Response.Write(\"cancel\");\n            GridView1.EditIndex = -1;\n            \/\/Bind data to the GridView control.\n            showdata();\n        }\n\n        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)\n        {\n\n            \/\/Update the values.\n            GridViewRow row = GridView1.Rows[e.RowIndex];\n            Label1.Text += ((TextBox)(row.Cells[2].Controls[0])).Text+\"&lt;br&gt;\";\n            Label1.Text += ((TextBox)(row.Cells[3].Controls[0])).Text +\"&lt;br&gt;\";\n            Label1.Text += ((TextBox)(row.Cells[4].Controls[0])).Text +\"&lt;br&gt;\";\n\n            \/\/\u66f4\u65b0\u7684SQL\u8a9e\u6cd5\n\n            string updatesql = \"UPDATE address_book SET name='\" + ((TextBox)(row.Cells[2].Controls[0])).Text + \"', phone='\" + ((TextBox)(row.Cells[3].Controls[0])).Text + \"',address='\" + ((TextBox)(row.Cells[4].Controls[0])).Text + \"' where sid=\" + ((TextBox)(row.Cells[1].Controls[0])).Text;\n            executeSQL(updatesql);\n\n            \/\/Reset the edit index.\n\n            GridView1.EditIndex = -1;\n\n            \/\/Bind data to the GridView control.\n            showdata();\n        }<\/pre>\n<p><a href=\"http:\/\/140.112.31.82\/websql\/mydb.sqlite\">\u8cc7\u6599\u5eab<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>void showdata() { \/\/\u5efa\u7acb\u8cc7\u6599\u8868 SQLiteConnection conn = new SQLiteConnection(&#8220;Data source=mydb.sqlite\"); \/\/ Open conn.Open(); \/\/\u8981\u4e0b\u4efb\u4f55\u547d\u4ee4\u5148\u53d6\u5f97\u8a72\u9023\u7d50\u7684\u57f7\u884c\u547d\u4ee4\u7269\u4ef6 SQLiteCommand cmd = conn.CreateCommand(); \/\/ \u5efa\u7acb\u8cc7\u6599\u8868 cmd.Connection = conn; cmd.CommandText = &#8220;SELECT * FROM address_book\"; \/\/ \u57f7\u884c\u67e5\u8a62\u585e\u5165 sqlite_datareader SQLiteDataReader sqlite_datareader = cmd.ExecuteReader(); GridView1.DataSource = sqlite_datareader; GridView1.DataBind(); conn.Close(); } void executeSQL(string sql) { SQLiteConnection conn = new SQLiteConnection(&#8220;Data source=mydb.sqlite\"); conn.Open(); SQLiteCommand cmd &hellip; <a href=\"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b\" class=\"more-link\">\u95b1\u8b80\u5168\u6587 <span class=\"screen-reader-text\">ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[4],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc - \u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed\u8ab2\u7a0b\u7db2\u9801 (\u6797\u5947\u8ce6)<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cflin.com\/wordpress\/70\/\u7b2c\u4e5d\u5802-\u4e0a\u8ab2\u7bc4\u4f8b\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc - \u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed\u8ab2\u7a0b\u7db2\u9801 (\u6797\u5947\u8ce6)\" \/>\n<meta property=\"og:description\" content=\"void showdata() { \/\/\u5efa\u7acb\u8cc7\u6599\u8868 SQLiteConnection conn = new SQLiteConnection(&quot;Data source=mydb.sqlite&quot;); \/\/ Open conn.Open(); \/\/\u8981\u4e0b\u4efb\u4f55\u547d\u4ee4\u5148\u53d6\u5f97\u8a72\u9023\u7d50\u7684\u57f7\u884c\u547d\u4ee4\u7269\u4ef6 SQLiteCommand cmd = conn.CreateCommand(); \/\/ \u5efa\u7acb\u8cc7\u6599\u8868 cmd.Connection = conn; cmd.CommandText = &quot;SELECT * FROM address_book&quot;; \/\/ \u57f7\u884c\u67e5\u8a62\u585e\u5165 sqlite_datareader SQLiteDataReader sqlite_datareader = cmd.ExecuteReader(); GridView1.DataSource = sqlite_datareader; GridView1.DataBind(); conn.Close(); } void executeSQL(string sql) { SQLiteConnection conn = new SQLiteConnection(&quot;Data source=mydb.sqlite&quot;); conn.Open(); SQLiteCommand cmd &hellip; \u95b1\u8b80\u5168\u6587 ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cflin.com\/wordpress\/70\/\u7b2c\u4e5d\u5802-\u4e0a\u8ab2\u7bc4\u4f8b\" \/>\n<meta property=\"og:site_name\" content=\"\u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed\u8ab2\u7a0b\u7db2\u9801 (\u6797\u5947\u8ce6)\" \/>\n<meta property=\"article:published_time\" content=\"2013-11-20T04:33:21+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chifu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cflin.com\/wordpress\/#website\",\"url\":\"https:\/\/cflin.com\/wordpress\/\",\"name\":\"\u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed\u8ab2\u7a0b\u7db2\u9801 (\u6797\u5947\u8ce6)\",\"description\":\"\u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed python \u8ab2\u7a0b\u76f8\u95dc\u8cc7\u6599\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cflin.com\/wordpress\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-TW\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b#webpage\",\"url\":\"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b\",\"name\":\"ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc - \u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed\u8ab2\u7a0b\u7db2\u9801 (\u6797\u5947\u8ce6)\",\"isPartOf\":{\"@id\":\"https:\/\/cflin.com\/wordpress\/#website\"},\"datePublished\":\"2013-11-20T04:33:21+00:00\",\"dateModified\":\"2013-11-20T04:33:21+00:00\",\"author\":{\"@id\":\"https:\/\/cflin.com\/wordpress\/#\/schema\/person\/fcc9937e50465bfaa039229ad12d89aa\"},\"breadcrumb\":{\"@id\":\"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9801\",\"item\":\"https:\/\/cflin.com\/wordpress\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/cflin.com\/wordpress\/#\/schema\/person\/fcc9937e50465bfaa039229ad12d89aa\",\"name\":\"Chifu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\/\/cflin.com\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/83c3d40c89fb05d334f2a3eddcfb4ac7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/83c3d40c89fb05d334f2a3eddcfb4ac7?s=96&d=mm&r=g\",\"caption\":\"Chifu\"},\"sameAs\":[\"http:\/\/cflin.com\"],\"url\":\"https:\/\/cflin.com\/wordpress\/author\/daky\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc - \u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed\u8ab2\u7a0b\u7db2\u9801 (\u6797\u5947\u8ce6)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cflin.com\/wordpress\/70\/\u7b2c\u4e5d\u5802-\u4e0a\u8ab2\u7bc4\u4f8b","og_locale":"zh_TW","og_type":"article","og_title":"ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc - \u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed\u8ab2\u7a0b\u7db2\u9801 (\u6797\u5947\u8ce6)","og_description":"void showdata() { \/\/\u5efa\u7acb\u8cc7\u6599\u8868 SQLiteConnection conn = new SQLiteConnection(\"Data source=mydb.sqlite\"); \/\/ Open conn.Open(); \/\/\u8981\u4e0b\u4efb\u4f55\u547d\u4ee4\u5148\u53d6\u5f97\u8a72\u9023\u7d50\u7684\u57f7\u884c\u547d\u4ee4\u7269\u4ef6 SQLiteCommand cmd = conn.CreateCommand(); \/\/ \u5efa\u7acb\u8cc7\u6599\u8868 cmd.Connection = conn; cmd.CommandText = \"SELECT * FROM address_book\"; \/\/ \u57f7\u884c\u67e5\u8a62\u585e\u5165 sqlite_datareader SQLiteDataReader sqlite_datareader = cmd.ExecuteReader(); GridView1.DataSource = sqlite_datareader; GridView1.DataBind(); conn.Close(); } void executeSQL(string sql) { SQLiteConnection conn = new SQLiteConnection(\"Data source=mydb.sqlite\"); conn.Open(); SQLiteCommand cmd &hellip; \u95b1\u8b80\u5168\u6587 ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc &rarr;","og_url":"https:\/\/cflin.com\/wordpress\/70\/\u7b2c\u4e5d\u5802-\u4e0a\u8ab2\u7bc4\u4f8b","og_site_name":"\u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed\u8ab2\u7a0b\u7db2\u9801 (\u6797\u5947\u8ce6)","article_published_time":"2013-11-20T04:33:21+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Chifu","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/cflin.com\/wordpress\/#website","url":"https:\/\/cflin.com\/wordpress\/","name":"\u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed\u8ab2\u7a0b\u7db2\u9801 (\u6797\u5947\u8ce6)","description":"\u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed python \u8ab2\u7a0b\u76f8\u95dc\u8cc7\u6599","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cflin.com\/wordpress\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-TW"},{"@type":"WebPage","@id":"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b#webpage","url":"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b","name":"ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc - \u53f0\u5927\u7cfb\u7d71\u8a13\u7df4\u73ed\u8ab2\u7a0b\u7db2\u9801 (\u6797\u5947\u8ce6)","isPartOf":{"@id":"https:\/\/cflin.com\/wordpress\/#website"},"datePublished":"2013-11-20T04:33:21+00:00","dateModified":"2013-11-20T04:33:21+00:00","author":{"@id":"https:\/\/cflin.com\/wordpress\/#\/schema\/person\/fcc9937e50465bfaa039229ad12d89aa"},"breadcrumb":{"@id":"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cflin.com\/wordpress\/70\/%e7%ac%ac%e4%b9%9d%e5%a0%82-%e4%b8%8a%e8%aa%b2%e7%af%84%e4%be%8b#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9801","item":"https:\/\/cflin.com\/wordpress"},{"@type":"ListItem","position":2,"name":"ASP.NET SQLite Sample \u4e0a\u8ab2\u7bc4\u4f8b\u7a0b\u5f0f\u78bc"}]},{"@type":"Person","@id":"https:\/\/cflin.com\/wordpress\/#\/schema\/person\/fcc9937e50465bfaa039229ad12d89aa","name":"Chifu","image":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/cflin.com\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/83c3d40c89fb05d334f2a3eddcfb4ac7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/83c3d40c89fb05d334f2a3eddcfb4ac7?s=96&d=mm&r=g","caption":"Chifu"},"sameAs":["http:\/\/cflin.com"],"url":"https:\/\/cflin.com\/wordpress\/author\/daky"}]}},"_links":{"self":[{"href":"https:\/\/cflin.com\/wordpress\/wp-json\/wp\/v2\/posts\/70"}],"collection":[{"href":"https:\/\/cflin.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cflin.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cflin.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cflin.com\/wordpress\/wp-json\/wp\/v2\/comments?post=70"}],"version-history":[{"count":0,"href":"https:\/\/cflin.com\/wordpress\/wp-json\/wp\/v2\/posts\/70\/revisions"}],"wp:attachment":[{"href":"https:\/\/cflin.com\/wordpress\/wp-json\/wp\/v2\/media?parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cflin.com\/wordpress\/wp-json\/wp\/v2\/categories?post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cflin.com\/wordpress\/wp-json\/wp\/v2\/tags?post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}