{"id":9953,"date":"2017-03-31T23:06:18","date_gmt":"2017-03-31T15:06:18","guid":{"rendered":"http:\/\/www.vbtutor.net\/?page_id=9953"},"modified":"2018-02-26T23:43:03","modified_gmt":"2018-02-26T15:43:03","slug":"visual-basic-2017-lesson-8-managing-data","status":"publish","type":"page","link":"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-8-managing-data\/","title":{"rendered":"Visual Basic 2017 Lesson 8: Managing Data"},"content":{"rendered":"<h4 style=\"text-align: center;\"><a title=\"visual basic 2015 tutorial lesson 7\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-7working-picture-box\/\">[Lesson 7]<\/a> &lt;&lt; <a title=\"Visual Basic 2015 tutorial\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-tutorial\/\">[Contents] <\/a>&gt;&gt; <a title=\"visual basic 2015 Lesson 9\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-9-working-variables-constants\/\">[Lesson 9]<\/a><\/h4>\n<p>In everyday life, we have to deal with all kinds of information and data. For example, we need to deal with data like names, money, phone number, addresses, date, stock quotes and more.<\/p>\n<p>Similarly, in Visual Basic 2017, we have to deal with all sorts of data, some of them can be mathematically calculated while some are in the form of text or other non-numeric forms. In Visual Basic 2017, data can be stored as variables, constants or arrays. The values of data stored as variables always change, just like the contents of a mailbox or the storage bin while the value of a constant remains the same throughout.<\/p>\n<div><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-3033628290023372\" data-ad-slot=\"3393818013\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/div>\n<h3>8.1 Visual Basic 2017 Data Types<\/h3>\n<p>Visual Basic 2017 classifies information into two major data types, \u00a0the numeric data types, and the non-numeric data type<\/p>\n<h4>8.1.1 Numeric Data Types<\/h4>\n<p>In Visual Basic 2017, numeric data types are types of data comprises numbers that can be calculated using various standard arithmetic operators. Examples of numeric data types are examination marks, height, body weight, the number of students in a class, share values, the price of goods, monthly bills, fees, bus fares and more. In Visual Basic 2017, numeric data are classified into seven types based on the range of values they can store. Numeric data that involve round figures are classified as Integer or Long integer. Data\u00a0that require high precision calculation are classified as single and double precision data types, they are also called floating point numbers. Numeric data that involve money are classified as currency data types. Lastly, data that require more precision and involve many decimal points are classified as decimal data types. These data types are summarized in Table 8.1<\/p>\n<h4 align=\"center\">Table 8.1: Numeric Data Types<\/h4>\n<div style=\"overflow-x: auto;\">TypeStorageRange of Values<\/p>\n<table width=\"100%\">\n<tbody>\n<tr>\n<td>\u00a0Byte<\/td>\n<td>\u00a01 byte<\/td>\n<td>\u00a0 0 to 255<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Integer<\/td>\n<td>\u00a02\u00a0bytes<\/td>\n<td>\u00a0 -32,768 to 32,767<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Long<\/td>\n<td>\u00a04\u00a0bytes<\/td>\n<td>\u00a0-2,147,483,648 to\u00a02,147,483,648<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Single<\/td>\n<td>\u00a04\u00a0bytes<\/td>\n<td>-3.402823E+38 to -1.401298E-45 for negative values<br \/>\n1.401298E-45 to 3.402823E+38 for positive values.<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Double<\/td>\n<td>\u00a08\u00a0bytes<\/td>\n<td>-1.79769313486232e+308 to -4.94065645841247E-324 for negative values<br \/>\n4.94065645841247E-324 to 1.79769313486232e+308 for positive values.<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Currency<\/td>\n<td>\u00a08\u00a0bytes<\/td>\n<td>-922,337,203,685,477.5808 to 922,337,203,685,477.5807<\/td>\n<\/tr>\n<tr>\n<td>\u00a0Decimal<\/td>\n<td>\u00a012\u00a0bytes<\/td>\n<td>+\/- 79,228,162,514,264,337,593,543,950,335 if no decimal is use<br \/>\n+\/- 7.9228162514264337593543950335 (28 decimal places).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-3033628290023372\" data-ad-slot=\"3393818013\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/div>\n<h4><strong>8.1.2 Non-numeric Data Types<\/strong><\/h4>\n<p>In Visual Basic 2017, non-numeric data types are data that cannot be calculated using standard arithmetic operators. The non-numeric data comprises text or string data types, the Date data types, the Boolean data types that store only two values (true or false), Object data type and Variant data type.They are summarized in Table 8.2<\/p>\n<h4 align=\"center\">Table 8.2: Non-numeric Data Types<\/h4>\n<div style=\"overflow-x: auto;\">\n<table>\n<tbody>\n<tr>\n<th>Type<\/th>\n<th>Storage<\/th>\n<th>Range<\/th>\n<\/tr>\n<tr>\n<td>String(fixed length)<\/td>\n<td>Length of string<\/td>\n<td>1 to 65,400 characters<\/td>\n<\/tr>\n<tr>\n<td>String(variable length)<\/td>\n<td>Length + 10 bytes<\/td>\n<td>0 to 2 billion characters<\/td>\n<\/tr>\n<tr>\n<td>Date<\/td>\n<td>\u00a08\u00a0bytes<\/td>\n<td>January 1, 100 to December 31, 9999<\/td>\n<\/tr>\n<tr>\n<td>Boolean<\/td>\n<td>\u00a02\u00a0bytes<\/td>\n<td>True or False<\/td>\n<\/tr>\n<tr>\n<td>Object<\/td>\n<td>\u00a04 bytes<\/td>\n<td>Any embedded object<\/td>\n<\/tr>\n<tr>\n<td>Variant(numeric)<\/td>\n<td>\u00a016\u00a0bytes<\/td>\n<td>Any value as large as Double<\/td>\n<\/tr>\n<tr>\n<td>Variant(text)<\/td>\n<td>Length+22 bytes<\/td>\n<td>Same as variable-length string<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h4>8.1.3 Suffixes for Literals<\/h4>\n<p>Literals are values that you assign to data. In some cases, we need to add a suffix behind a literal so that Visual Basic 2017 can handle the calculations more accurately. For example, we can use num=1.3089! for a single\u00a0precision data type, num=1.3089# for a double\u00a0precision data type, num=130890&amp; to indicate long integer data type and num=1.3089@ to indicate currency data type. The suffixes are summarized in Table 8.3.<\/p>\n<h4 align=\"center\">Table 8.3<\/h4>\n<div style=\"overflow-x: auto;\">\n<table>\n<tbody>\n<tr>\n<th>Suffix<\/th>\n<th>Data Type<\/th>\n<\/tr>\n<tr>\n<td>&amp;<\/td>\n<td>Long<\/td>\n<\/tr>\n<tr>\n<td>!<\/td>\n<td>Single<\/td>\n<\/tr>\n<tr>\n<td>#<\/td>\n<td>Double<\/td>\n<\/tr>\n<tr>\n<td>@<\/td>\n<td>Currency<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>In addition, we need to enclose string literals within two quotations and date and time literals within two # sign. Strings can contain any characters, including numbers. The following are few examples:<\/p>\n<p>memberName=&#8221;Turban, John.&#8221;<br \/>\nTelNumber=&#8221;1800-900-888-777&#8243;<br \/>\nLastDay=#31-Dec-00#<br \/>\nExpTime=#12:00 am#<\/p>\n<div><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<ins class=\"adsbygoogle\" style=\"display: block;\" data-ad-format=\"autorelaxed\" data-ad-client=\"ca-pub-3033628290023372\" data-ad-slot=\"9961025909\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/div>\n<h4 style=\"text-align: center;\"><a title=\"visual basic 2015 tutorial lesson 7\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-7working-picture-box\/\">[Lesson 7]<\/a> &lt;&lt; <a title=\"Visual Basic 2015 tutorial\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-tutorial\/\">[Contents] <\/a>&gt;&gt; <a title=\"visual basic 2015 lesson 9\" href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-9-working-variables-constants\/\">[Lesson 9]<\/a><\/h4>\n","protected":false},"excerpt":{"rendered":"<p>[Lesson 7] &lt;&lt; [Contents] &gt;&gt; [Lesson 9] In everyday life, we have to deal with all kinds of information and data. For example, we need to deal with data like names, money, phone number, addresses, date, stock quotes and more. Similarly, in Visual Basic 2017, we have to deal with all sorts of data, some &hellip; <a href=\"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-8-managing-data\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Visual Basic 2017 Lesson 8: Managing Data<\/span><\/a><\/p>\n","protected":false},"author":23013,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-9953","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Visual Basic 2017 Lesson 8: Managing Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB<\/title>\n<meta name=\"description\" content=\"Learn how to manage data in visual basic 2017\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Visual Basic 2017 Lesson 8: Managing Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\" \/>\n<meta property=\"og:description\" content=\"Learn how to manage data in visual basic 2017\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html\" \/>\n<meta property=\"og:site_name\" content=\"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Vbtutor\" \/>\n<meta property=\"article:modified_time\" content=\"2018-02-26T15:43:03+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@liewvk\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-8-managing-data\/\",\"url\":\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html\",\"name\":\"Visual Basic 2017 Lesson 8: Managing Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\",\"isPartOf\":{\"@id\":\"https:\/\/www.vbtutor.net\/#website\"},\"datePublished\":\"2017-03-31T15:06:18+00:00\",\"dateModified\":\"2018-02-26T15:43:03+00:00\",\"description\":\"Learn how to manage data in visual basic 2017\",\"breadcrumb\":{\"@id\":\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vbtutor.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Visual Basic 2017 Lesson 8: Managing Data\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vbtutor.net\/#website\",\"url\":\"https:\/\/www.vbtutor.net\/\",\"name\":\"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\",\"description\":\"Start learning Visual Basic from beginner to advanced. Includes VB.NET, VBA, and classic VB tutorials for students and professionals.\",\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Visual Basic 2017 Lesson 8: Managing Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","description":"Learn how to manage data in visual basic 2017","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":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html","og_locale":"en_US","og_type":"article","og_title":"Visual Basic 2017 Lesson 8: Managing Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","og_description":"Learn how to manage data in visual basic 2017","og_url":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html","og_site_name":"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","article_publisher":"https:\/\/www.facebook.com\/Vbtutor","article_modified_time":"2018-02-26T15:43:03+00:00","twitter_card":"summary_large_image","twitter_site":"@liewvk","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-8-managing-data\/","url":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html","name":"Visual Basic 2017 Lesson 8: Managing Data - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","isPartOf":{"@id":"https:\/\/www.vbtutor.net\/#website"},"datePublished":"2017-03-31T15:06:18+00:00","dateModified":"2018-02-26T15:43:03+00:00","description":"Learn how to manage data in visual basic 2017","breadcrumb":{"@id":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson8.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vbtutor.net\/"},{"@type":"ListItem","position":2,"name":"Visual Basic 2017 Lesson 8: Managing Data"}]},{"@type":"WebSite","@id":"https:\/\/www.vbtutor.net\/#website","url":"https:\/\/www.vbtutor.net\/","name":"Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","description":"Start learning Visual Basic from beginner to advanced. Includes VB.NET, VBA, and classic VB tutorials for students and professionals.","inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/9953","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/users\/23013"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/comments?post=9953"}],"version-history":[{"count":24,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/9953\/revisions"}],"predecessor-version":[{"id":12917,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/9953\/revisions\/12917"}],"wp:attachment":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/media?parent=9953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/categories?post=9953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/tags?post=9953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}