{"id":556,"date":"2017-04-14T11:05:54","date_gmt":"2017-04-14T02:05:54","guid":{"rendered":"https:\/\/onaraboo.com\/?p=556"},"modified":"2017-04-14T11:22:33","modified_gmt":"2017-04-14T02:22:33","slug":"visual-basic-net-sqlite%e3%81%ae%e5%88%a9%e7%94%a8%e2%91%a1","status":"publish","type":"post","link":"https:\/\/onaraboo.com\/?p=556","title":{"rendered":"Visual Basic.NET SQLite\u306e\u5229\u7528\u2461"},"content":{"rendered":"<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/onaraboo.com\/?p=556\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/onaraboo.com\/?p=556\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"Visual Basic.NET SQLite\u306e\u5229\u7528\u2461\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img loading=\"lazy\" decoding=\"async\" src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_line\"><a href='http:\/\/line.me\/R\/msg\/text\/?Visual%20Basic.NET%20SQLite%E3%81%AE%E5%88%A9%E7%94%A8%E2%91%A1%0D%0Ahttps%3A%2F%2Fonaraboo.com%2F%3Fp%3D556' title='LINE\u3067\u9001\u308b' rel=nofollow class='wp_social_bookmarking_light_a' ><img src='https:\/\/onaraboo.com\/wordpress\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/line20x20.png' alt='LINE\u3067\u9001\u308b' title='LINE\u3067\u9001\u308b' width='20' height='20' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/onaraboo.com\/?p=556\" data-text=\"Visual Basic.NET SQLite\u306e\u5229\u7528\u2461\" data-lang=\"ja\">Tweet<\/a><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n<h2>\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u30fb\u524a\u9664\u3059\u308b\u30ed\u30b8\u30c3\u30af\u30b5\u30f3\u30d7\u30eb<\/h2>\n<p>\u524d\u56de\u8a18\u4e8b\u306fSELECT\u6587\u3092\u767a\u884c\u3057\u3066\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u30ed\u30b8\u30c3\u30af\u3067\u3057\u305f\u304c\u3001\u4eca\u5ea6\u306fINSERT\u6587\u306e\u30b5\u30f3\u30d7\u30eb\u30ed\u30b8\u30c3\u30af\u3067\u3059\u3002<\/p>\n<h3>\u524d\u56de\u306e\u8a18\u4e8b<\/h3>\n<blockquote class=\"wp-embedded-content\" data-secret=\"VRVztM7o9f\"><p><a href=\"https:\/\/onaraboo.com\/?p=286\">Visual Basic.NET SQLite\u306e\u5229\u7528<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Visual Basic.NET SQLite\u306e\u5229\u7528&#8221; &#8212; \u4e0a\u306b\u306f\u4e0a\u304c\u3042\u308b\u3055\" src=\"https:\/\/onaraboo.com\/?p=286&#038;embed=true#?secret=vqqagOYU8f#?secret=VRVztM7o9f\" data-secret=\"VRVztM7o9f\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u306a\u304a\u3001\u3053\u306e\u30d6\u30ed\u30b0\u5185\u306b\u8a18\u8f09\u3057\u3066\u3044\u308b\u30bd\u30fc\u30b9\u306e\u8ee2\u8f09\u30fb\u8ee2\u7528\u306b\u3064\u3044\u3066\u306f\u4f55\u3082\u7e1b\u308a\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u3054\u4f7f\u7528\u306e\u72b6\u6cc1\u306e\u5982\u4f55\u306b\u554f\u308f\u305a\u3001\u4f5c\u8005\u305f\u308b\u5f53\u65b9\u306f\u7d50\u679c\u306b\u3064\u3044\u3066\u305d\u306e\u8cac\u4efb\u3092\u4e00\u5207\u8ca0\u3044\u307e\u305b\u3093\u3002\u3054\u4f7f\u7528\u306f\u81ea\u5df1\u8cac\u4efb\u306e\u7bc4\u56f2\u3067\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n\r\n    Private Function SQLite_Insert(ByVal GetData As DataTable, ByVal strSQLiteDB As String) As Boolean\r\n\r\n        SQLite_Insert = False\r\n\r\n        Try\r\n\r\n            '\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306e\u5b58\u5728\u78ba\u8a8d\r\n            If System.IO.File.Exists(strSQLiteDB) = False Then\r\n                '\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u30a8\u30e9\u30fc\u3092\u51fa\u529b\u3057\u3066\u7d42\u4e86\u3059\u308b\r\n                MessageBox.Show(&quot;\u30a8\u30e9\u30fc&quot;, &quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002&quot;, MessageBoxButtons.OK, MessageBoxIcon.Error)\r\n                Return False\r\n                Exit Function\r\n            End If\r\n\r\n            Dim Connection As New SQLiteConnection\r\n            Dim Command As SQLiteCommand\r\n            Dim DataExecute As Integer\r\n            Dim strSQL As String = String.Empty\r\n\r\n            '\u63a5\u7d9a\u6587\u5b57\u5217\u3092\u8a2d\u5b9a\r\n            Connection.ConnectionString = &quot;Version=3;Data Source=&quot; &amp; strSQLiteDB &amp; &quot;;New=False;Compress=True;&quot;\r\n\r\n            '\u30aa\u30fc\u30d7\u30f3\r\n            Connection.Open()\r\n\r\n            '\u30b3\u30de\u30f3\u30c9\u4f5c\u6210\r\n            Command = Connection.CreateCommand\r\n\r\n            For intI = 0 To GetData.Rows.Count - 1\r\n\r\n                '\u30c7\u30fc\u30bf\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9\u3092SQL\u3067DB\u306b\u66f8\u304d\u8fbc\u3080\r\n                '&lt;&lt;&lt; SQL\u3067\u633f\u5165\u3010NM01TOKU\u3011 &gt;&gt;&gt;\r\n                strSQL = &quot;INSERT INTO \u5f97\u610f\u5148\u30de\u30b9\u30bf VALUES &quot;\r\n                strSQL += &quot;(&quot; &amp; CType(GetData.Rows(intI).Item(&quot;\u5f97\u610f\u5148\u30b3\u30fc\u30c9&quot;).ToString, Long)\r\n                strSQL += &quot;,'&quot; &amp; GetData.Rows(intI).Item(&quot;\u5f97\u610f\u5148\u540d\u79f0\uff11&quot;).ToString.Replace(&quot;'&quot;, &quot;&quot;) &amp; &quot;'&quot;\r\n                strSQL += &quot;,'&quot; &amp; GetData.Rows(intI).Item(&quot;\u5f97\u610f\u5148\u540d\u79f0\uff12&quot;).ToString.Replace(&quot;'&quot;, &quot;&quot;) &amp; &quot;'&quot;\r\n                strSQL += &quot;,'&quot; &amp; GetData.Rows(intI).Item(&quot;\u5927\u5206\u985e\u30b3\u30fc\u30c9&quot;).ToString &amp; &quot;'&quot;\r\n                strSQL += &quot;,'&quot; &amp; GetData.Rows(intI).Item(&quot;\u4e2d\u5206\u985e\u30b3\u30fc\u30c9&quot;).ToString &amp; &quot;'&quot;\r\n                strSQL += &quot;,'&quot; &amp; GetData.Rows(intI).Item(&quot;\u5c0f\u5206\u985e\u30b3\u30fc\u30c9&quot;).ToString &amp; &quot;')&quot;\r\n\r\n                'SQL\u3092\u30bb\u30c3\u30c8\r\n                Command.CommandText = strSQL\r\n                '\u30c7\u30fc\u30bf\u66f4\u65b0\r\n                DataExecute = Command.ExecuteNonQuery()\r\n\r\n            Next\r\n\r\n            '\u7834\u68c4\r\n            Command.Dispose()\r\n            Connection.Close()\r\n            Connection.Dispose()\r\n\r\n            Return True\r\n\r\n        Catch ex As Exception\r\n            '\u3053\u3053\u3067\u30a8\u30e9\u30fc\u51e6\u7406\r\n            Return False\r\n\r\n        End Try\r\n\r\n    End Function\r\n\r\n<\/pre>\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306fDataTable\u3067\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092SQLite\u4e0a\u306e\u5f97\u610f\u5148\u30de\u30b9\u30bf\u306b\u683c\u7d0d\u3057\u3066\u3044\u308b\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<br \/>\nINSERT\u6642\u306b.Replace(&#8220;&#8216;&#8221;, &#8220;&#8221;)\u3057\u3066\u3044\u308b\u306e\u306f\u5f97\u610f\u5148\u540d\u79f0\uff11\u30fb\uff12\u306b\u300c&#8217;\u300d\u304c\u767b\u9332\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u306e\u5bfe\u5fdc\u51e6\u7406\u3067\u3059\u3002<\/p>\n<p>\u307e\u3060\u307e\u3060\u5fdc\u7528\u3084\u4f7f\u3044\u9053\u306b\u3064\u3044\u3066\u8abf\u3079\u3066\u30e1\u30e2\u3057\u307e\u3059\u3002\u6b21\u56de\u3078\u7d9a\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u30fb\u524a\u9664\u3059\u308b\u30ed\u30b8\u30c3\u30af\u30b5\u30f3\u30d7\u30eb \u524d\u56de\u8a18\u4e8b\u306fSELECT\u6587\u3092\u767a\u884c\u3057\u3066\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u30ed\u30b8\u30c3\u30af\u3067\u3057\u305f\u304c\u3001\u4eca\u5ea6\u306fINSERT\u6587\u306e\u30b5\u30f3\u30d7\u30eb\u30ed\u30b8\u30c3\u30af\u3067\u3059\u3002 \u524d\u56de\u306e\u8a18\u4e8b Visual Basic.NET &#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/onaraboo.com\/?p=556\">Read more<span class=\"screen-reader-text\">Visual Basic.NET SQLite\u306e\u5229\u7528\u2461<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,5,2],"tags":[],"class_list":["post-556","post","type-post","status-publish","format-standard","hentry","category-visual-basic-net","category-5","category-2","entry"],"_links":{"self":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/posts\/556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=556"}],"version-history":[{"count":0,"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/posts\/556\/revisions"}],"wp:attachment":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}