{"id":135,"date":"2016-02-18T14:48:29","date_gmt":"2016-02-18T14:48:29","guid":{"rendered":"https:\/\/ibex.tech\/csharp\/?p=135"},"modified":"2023-11-29T15:56:56","modified_gmt":"2023-11-29T15:56:56","slug":"update","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/c-sharp\/databases\/sqlite\/queries\/update","title":{"rendered":"UPDATE queries"},"content":{"rendered":"<h4>\n\tUPDATE query example<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\t\/\/----- DO QUERY -----\r\n\tCommand1 = new System.Data.SQLite.SQLiteCommand(Connection1);\r\n\tCommand1.CommandText = @&quot;UPDATE tblBookLanguages SET\r\n\t\t\t\t\t\t\t\tLanguageText = @LanguageText,\r\n\t\t\t\t\t\t\t\tLanguageImage = @LanguageImage\r\n\t\t\t\t\t\t\tWHERE LanguageId = @LanguageId&quot;;\t\t\t\r\n\tCommand1.Parameters.AddWithValue(&quot;@LanguageText&quot;, LanguageText);\r\n\tif (LanguageImage.Length &gt; 0)\r\n\t\tCommand1.Parameters.AddWithValue(&quot;@LanguageImage&quot;, LanguageImage);\r\n\telse\r\n\t\tCommand1.Parameters.AddWithValue(&quot;@LanguageImage&quot;, DBNull.Value);\r\n\tCommand1.Parameters.AddWithValue(&quot;@LanguageId&quot;, LanguageId);\r\n\t\t\t\t\r\n\tCommand1.ExecuteNonQuery();\r\n<\/code><\/pre>\n<p>\n\t&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UPDATE query example \/\/&#8212;&#8211; DO QUERY &#8212;&#8211; Command1 = new System.Data.SQLite.SQLiteCommand(Connection1); Command1.CommandText = @&quot;UPDATE tblBookLanguages SET LanguageText = @LanguageText, LanguageImage = @LanguageImage WHERE LanguageId = @LanguageId&quot;; Command1.Parameters.AddWithValue(&quot;@LanguageText&quot;, LanguageText); if (LanguageImage.Length &gt; 0) Command1.Parameters.AddWithValue(&quot;@LanguageImage&quot;, LanguageImage); else Command1.Parameters.AddWithValue(&quot;@LanguageImage&quot;, DBNull.Value); Command1.Parameters.AddWithValue(&quot;@LanguageId&quot;, LanguageId); Command1.ExecuteNonQuery(); &nbsp;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-queries"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=135"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/135\/revisions"}],"predecessor-version":[{"id":1323,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/135\/revisions\/1323"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}