{"id":10200,"date":"2017-04-11T17:15:55","date_gmt":"2017-04-11T09:15:55","guid":{"rendered":"http:\/\/www.vbtutor.net\/?page_id=10200"},"modified":"2018-06-22T15:15:59","modified_gmt":"2018-06-22T07:15:59","slug":"visual-basic-2017-lesson-34-creating-databases","status":"publish","type":"page","link":"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-34-creating-databases\/","title":{"rendered":"Visual Basic 2017 Lesson 34: Creating A Database"},"content":{"rendered":"<h4 style=\"text-align: center;\"><a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-33-creating-animation\/\">[Lesson 33] <\/a>&lt;&lt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-tutorial\/\">[Contents]<\/a> &gt;&gt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-35-creating-connection-databases\/\">[Lesson 35]<\/a><\/h4>\n<h3>34.1 Introduction to Database<\/h3>\n<p>In our daily life, we deal with various data such as names, addresses, money, date, stock quotes, statistics and more. If you are in business or working as a professional, you have to handle even more data. For example, a doctor needs to keep track of patients\u2019 personal and medical information such as names, addresses, phone numbers as well as blood pressure readings, blood sugar readings, surgical history, medicines prescribed in the past and more. On the other hand, businesses usually have to manage a large amount of data pertaining to products and customers. All these data need to be organized into a database for the ease of data management.<\/p>\n<p>In the past, people usually deal with data manually like using cards and folders. However, in present-day digital age, it is no longer feasible to manage data manually. Most data are now managed using computer-based database management systems. Computer-based Database management systems can handle data much faster and more efficient than human beings do. With the advent of the network and the Internet technologies, data can now be managed locally and remotely.Companies usually invest heavily in database management systems in order to run the organizations efficiently and effectively.<br \/>\n<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><br \/>\nDatabase management systems are usually used in running payroll system, inventory system, accounting system, payment system, order handling system, customer relationship management system(CRM) and more. Some of the commercial database management system(DBMS) are Oracle, Microsoft SQL server and Microsoft Access.<\/p>\n<h3>34.2 Creating a Database Application<\/h3>\n<p>A database management system typically deals with storing, modifying, and extracting information from a database. It can also add, edit and delete records from the database. However, a DBMS can be very difficult to handle by ordinary people or businessmen who have no technological backgrounds. Fortunately, we can create user-friendly database applications to handle the aforementioned jobs with the DBMS running in the background. One of the best programs that can create such database application is none other than Visual Basic 2017.<\/p>\n<p>Visual Basic 2017 uses ADO.NET to handle databases. ADO.NET is Microsoft\u2019s latest database technology which can work with many other advanced database management systems such as Microsoft SQL server. In this lesson, we will develop codes that make use of Microsoft SQL Server 2016, therefore you need to have Microsoft SQL Server 2016 installed in your PC, \u00a0you can download\u00a0Microsoft SQL Server 2016 Express for free from\u00a0<a href=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/sql-server-downloads\">https:\/\/www.microsoft.com\/en-us\/sql-server\/sql-server-downloads.<\/a><\/p>\n<p>To begin building the database project in Visual Basic 2017, launch Visual Basic 2017. You can name your project as Database Project 1 or whatever name you wish to call it. Next, change the default form\u2019s Text property to Contacts as we will be building a database of a contact list. There are a few objects in ADO.NET that are required to build the database. There are:<\/p>\n<ul>\n<li><strong>SqlConnection<\/strong>&#8211; to connect to a data source in SQL Server<\/li>\n<li><strong>DataTable<\/strong> -to store data for navigation and manipulation<\/li>\n<li><strong>DataAdapter<\/strong>&#8211; to populate a DataReader<\/li>\n<\/ul>\n<p><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><\/p>\n<p>The aforementioned objects belong to the System.Data and the System.Xml namespace. Therefore, we need to reference them in the beginning before we can work with them. To reference the ADO.NET object, choose project from the menu then select Database Project 1 properties to display the project properties. Next click the References tab to show the active references for the project, as shown in Figure 34.1<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5089\" src=\"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg\" alt=\"vb2013_figure33.1\" width=\"998\" height=\"658\" \/><\/a><strong>Figure 34.1<\/strong><\/p>\n<p>Under imported namespaces, make sure system.data, System.Data.Sqlclient is selected, otherwise, check them. Having done that you need to click the Save All button on the toolbar and then return to the Visual Basic 2017 IDE.<\/p>\n<p>We shall proceed to create a connection to the database source file in the next lesson.<br \/>\n<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><\/p>\n<h4 style=\"text-align: center;\"><a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-33-creating-animation\/\">[Lesson 33] <\/a>&lt;&lt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-tutorial\/\">[Contents]<\/a> &gt;&gt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-35-creating-connection-databases\/\">[Lesson 35]<\/a><\/h4>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Lesson 33] &lt;&lt; [Contents] &gt;&gt; [Lesson 35] 34.1 Introduction to Database In our daily life, we deal with various data such as names, addresses, money, date, stock quotes, statistics and more. If you are in business or working as a professional, you have to handle even more data. For example, a doctor needs to keep &hellip; <a href=\"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2017-lesson-34-creating-databases\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Visual Basic 2017 Lesson 34: Creating A Database<\/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-10200","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 34: Creating A Database - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB<\/title>\n<meta name=\"description\" content=\"Learn how to create a database 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_lesson34.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 34: Creating A Database - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\" \/>\n<meta property=\"og:description\" content=\"Learn how to create a database in visual basic 2017\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.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-06-22T07:15:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"998\" \/>\n\t<meta property=\"og:image:height\" content=\"658\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\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-34-creating-databases\/\",\"url\":\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html\",\"name\":\"Visual Basic 2017 Lesson 34: Creating A Database - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\",\"isPartOf\":{\"@id\":\"https:\/\/www.vbtutor.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html#primaryimage\"},\"image\":{\"@id\":\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg\",\"datePublished\":\"2017-04-11T09:15:55+00:00\",\"dateModified\":\"2018-06-22T07:15:59+00:00\",\"description\":\"Learn how to create a database in visual basic 2017\",\"breadcrumb\":{\"@id\":\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html#primaryimage\",\"url\":\"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg\",\"contentUrl\":\"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg\",\"width\":998,\"height\":658},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vbtutor.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Visual Basic 2017 Lesson 34: Creating A Database\"}]},{\"@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 34: Creating A Database - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","description":"Learn how to create a database 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_lesson34.html","og_locale":"en_US","og_type":"article","og_title":"Visual Basic 2017 Lesson 34: Creating A Database - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","og_description":"Learn how to create a database in visual basic 2017","og_url":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.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-06-22T07:15:59+00:00","og_image":[{"width":998,"height":658,"url":"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg","type":"image\/jpeg"}],"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-34-creating-databases\/","url":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html","name":"Visual Basic 2017 Lesson 34: Creating A Database - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","isPartOf":{"@id":"https:\/\/www.vbtutor.net\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html#primaryimage"},"image":{"@id":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html#primaryimage"},"thumbnailUrl":"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg","datePublished":"2017-04-11T09:15:55+00:00","dateModified":"2018-06-22T07:15:59+00:00","description":"Learn how to create a database in visual basic 2017","breadcrumb":{"@id":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html#primaryimage","url":"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg","contentUrl":"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg","width":998,"height":658},{"@type":"BreadcrumbList","@id":"http:\/\/www.vbtutor.net\/vb2017\/vb2017_lesson34.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vbtutor.net\/"},{"@type":"ListItem","position":2,"name":"Visual Basic 2017 Lesson 34: Creating A Database"}]},{"@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\/10200","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=10200"}],"version-history":[{"count":18,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/10200\/revisions"}],"predecessor-version":[{"id":13011,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/10200\/revisions\/13011"}],"wp:attachment":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/media?parent=10200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/categories?post=10200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/tags?post=10200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}