{"id":1889,"date":"2019-10-04T00:20:19","date_gmt":"2019-10-03T15:20:19","guid":{"rendered":"http:\/\/idealive.jp\/blog\/?p=1889"},"modified":"2019-10-04T00:20:19","modified_gmt":"2019-10-03T15:20:19","slug":"vb-net-sqlparameter%e3%82%af%e3%83%a9%e3%82%b9%e3%81%ae%e7%b4%b9%e4%bb%8b","status":"publish","type":"post","link":"https:\/\/idealive.jp\/blog\/2019\/10\/04\/vb-net-sqlparameter%e3%82%af%e3%83%a9%e3%82%b9%e3%81%ae%e7%b4%b9%e4%bb%8b\/","title":{"rendered":"VB.NET SqlParameter\u30af\u30e9\u30b9\u306e\u7d39\u4ecb"},"content":{"rendered":"<p>\u7686\u3055\u3093\u3053\u3093\u306b\u3061\u306fr.matsumoto\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306fVB.NET\u306eSqlParameter\u30af\u30e9\u30b9\u306b\u3064\u3044\u3066\u66f8\u3044\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h5>SqlParameter\u3068\u306f<\/h5>\n<p>SqlParameter\u3068\u306f\u540d\u524d\u306e\u901a\u308aSQL\u306b\u57cb\u3081\u8fbc\u3093\u3067\u4f7f\u3046\u3053\u3068\u304c\u51fa\u6765\u308b\u5909\u6570\u306e\u3088\u3046\u306a\u7269\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u3060\u3051\u306a\u3089SQL\u3092\u767a\u884c\u3059\u308b\u6642\u306b\u76f4\u63a5\u5909\u6570\u3092\u57cb\u3081\u8fbc\u3093\u3067\u3082\u540c\u3058\u306a\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u308f\u308c\u308b\u65b9\u3082\u5c45\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u5b9f\u969b\u79c1\u3082\u521d\u3081\u306f\u76f4\u63a5\u5909\u6570\u3092\u57cb\u3081\u8fbc\u3080\u306e\u3068\u4f55\u304c\u9055\u3046\u306e\u304b\u5206\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u3067\u306fSQL\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f7f\u3046\u3053\u3068\u306e\u30e1\u30ea\u30c3\u30c8\u306b\u306f\u3069\u306e\u69d8\u306a\u4e8b\u304c\u3042\u308b\u304b\u3068\u3044\u3046\u3068\u3001\u307e\u305a\u4e00\u3064\u306fSQL\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u826f\u3044\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<p>SQL\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u7528\u3044\u308b\u3068\u8907\u6570\u56de\u540c\u3058SQL\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u5b9f\u884c\u8a08\u753b\u3092\u518d\u5229\u7528\u3057\u3066\u304f\u308c\u3066\u51e6\u7406\u901f\u5ea6\u304c\u901f\u304f\u306a\u308a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3082\u4e0a\u304c\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u305d\u306e\u4ed6\u306b\u3082SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u5bfe\u7b56\u306b\u306a\u3063\u305f\u308a\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3092\u4ed8\u3051\u308b\u624b\u9593\u3092\u7701\u3051\u305f\u308a\u8272\u3005\u306a\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h5>SqlParameter\u306e\u4f7f\u3044\u65b9<\/h5>\n<p>\u3067\u306f\u5b9f\u969b\u306e\u4f7f\u3044\u65b9\u306a\u306e\u3067\u3059\u304c\u3001\u5b9f\u884c\u3057\u305f\u3044SQL\u306b@\u30d1\u30e9\u30e1\u30fc\u30bf\u540d\u3092\u57cb\u3081\u8fbc\u307f\u305d\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u5024\u3092\u6e21\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:vbnet decode:true \">Dim sqlStr As String = \"SELECT * FROM emp WHERE name = @name\"\r\n\r\nDim command As SqlCommand = New SqlCommand(sqlStr, sqlConnect)\r\n\r\nDim param As New SqlParameter(\"@name\", SqlDbType.VarChar)\r\nparam.Value = \"matsumoto\"\r\ncommand.Parameters.Add(param)<\/pre>\n<p>\u4eca\u56de\u306f\u7c21\u5358\u306a\u4f8b\u3068\u3057\u3066\u5024\u3092\u76f4\u63a5\u6e21\u3057\u307e\u3057\u305f\u304c\u3001\u5b9f\u7528\u7684\u306a\u4f7f\u3044\u65b9\u3068\u3057\u3066\u306f\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u5165\u529b\u3055\u308c\u305f\u5024\u3092SqlParameter\u306b\u30bb\u30c3\u30c8\u3057\u3066\u4f7f\u7528\u3057\u305f\u308a\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>VB.NET\u3067\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u306e\u5024\u3092\u305d\u306e\u307e\u307e\u4f7f\u3048\u305f\u3089\u306a\u3068\u601d\u3063\u3066\u3044\u308b\u65b9\u306f\u662f\u975e\u8a66\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7686\u3055\u3093\u3053\u3093\u306b\u3061\u306fr.matsumoto\u3067\u3059\u3002 \u4eca\u56de\u306fVB.NET\u306eSqlParameter\u30af\u30e9\u30b9\u306b\u3064\u3044\u3066\u66f8\u3044\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002 SqlParameter\u3068\u306f SqlParameter\u3068\u306f\u540d\u524d\u306e\u901a\u308aSQL\u306b\u57cb\u3081\u8fbc\u3093\u3067\u4f7f\u3046&#8230;<a class=\"read-more-link button\" href=\"https:\/\/idealive.jp\/blog\/2019\/10\/04\/vb-net-sqlparameter%e3%82%af%e3%83%a9%e3%82%b9%e3%81%ae%e7%b4%b9%e4%bb%8b\/\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":10,"featured_media":1891,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1889","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts\/1889"}],"collection":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/comments?post=1889"}],"version-history":[{"count":1,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts\/1889\/revisions"}],"predecessor-version":[{"id":1892,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts\/1889\/revisions\/1892"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/media\/1891"}],"wp:attachment":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/media?parent=1889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/categories?post=1889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/tags?post=1889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}