{"id":7297,"date":"2015-10-27T14:59:28","date_gmt":"2015-10-27T06:59:28","guid":{"rendered":"http:\/\/www.vbtutor.net\/?page_id=7297"},"modified":"2018-06-22T22:22:40","modified_gmt":"2018-06-22T14:22:40","slug":"visual-basic-2015-lesson-34-creating-databases","status":"publish","type":"page","link":"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-lesson-34-creating-databases\/","title":{"rendered":"Visual Basic 2015 Lesson 34: Creating Databases"},"content":{"rendered":"<h4 style=\"text-align: center;\"><a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-lesson-33-creating-animation\/\">[Lesson 33] <\/a>&lt;&lt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-tutorial\/\">[Contents]<\/a> &gt;&gt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-lesson-35-creating-connection-databases\/\">[Lesson 35]<\/a><\/h4>\n<h3>34.1 Introduction to Database in Visual Basic 2015<\/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 Information 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.<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=\"4768455349\"><\/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 in Visual Basic 2015<\/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 2015.<\/p>\n<p>Visual Basic 2015 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 2015, therefore you need to have Microsoft SQL Server 2012 installed in your PC, \u00a0you can download\u00a0Microsoft SQL Server 2012 Express \u00a0for free\u00a0\u00a0from\u00a0<a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=29062\">http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=29062<\/a>.<\/p>\n<p>To build a database project , launch Visual Basic 2015. Name your project Database Project 1 or whatever name you wish to call it. Next, change the default form\u2019s Text property to Contacts. 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=\"4768455349\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><br \/>\nThe aforementioned objects belongs 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 2015 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\"\n     style=\"display:block\"\n     data-ad-format=\"autorelaxed\"\n     data-ad-client=\"ca-pub-3033628290023372\"\n     data-ad-slot=\"5090773108\"><\/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-2015-lesson-33-creating-animation\/\">[Lesson 33] <\/a>&lt;&lt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-tutorial\/\">[Contents]<\/a> &gt;&gt; <a href=\"http:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-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 Visual Basic 2015 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 &hellip; <a href=\"https:\/\/www.vbtutor.net\/index.php\/visual-basic-2015-lesson-34-creating-databases\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Visual Basic 2015 Lesson 34: Creating Databases<\/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-7297","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 2015 Lesson 34: Creating Databases - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB<\/title>\n<meta name=\"description\" content=\"This article discusses how to create databases in visual basic 2015\" \/>\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\/vb2015\/vb2015_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 2015 Lesson 34: Creating Databases - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\" \/>\n<meta property=\"og:description\" content=\"This article discusses how to create databases in visual basic 2015\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_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-22T14:22:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg\" \/>\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-2015-lesson-34-creating-databases\/\",\"url\":\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson34.html\",\"name\":\"Visual Basic 2015 Lesson 34: Creating Databases - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB\",\"isPartOf\":{\"@id\":\"https:\/\/www.vbtutor.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson34.html#primaryimage\"},\"image\":{\"@id\":\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson34.html#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg\",\"datePublished\":\"2015-10-27T06:59:28+00:00\",\"dateModified\":\"2018-06-22T14:22:40+00:00\",\"description\":\"This article discusses how to create databases in visual basic 2015\",\"breadcrumb\":{\"@id\":\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson34.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson34.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.vbtutor.net\/vb2015\/vb2015_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\/vb2015\/vb2015_lesson34.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vbtutor.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Visual Basic 2015 Lesson 34: Creating Databases\"}]},{\"@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 2015 Lesson 34: Creating Databases - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","description":"This article discusses how to create databases in visual basic 2015","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\/vb2015\/vb2015_lesson34.html","og_locale":"en_US","og_type":"article","og_title":"Visual Basic 2015 Lesson 34: Creating Databases - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","og_description":"This article discusses how to create databases in visual basic 2015","og_url":"http:\/\/www.vbtutor.net\/vb2015\/vb2015_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-22T14:22:40+00:00","og_image":[{"url":"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg","type":"","width":"","height":""}],"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-2015-lesson-34-creating-databases\/","url":"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson34.html","name":"Visual Basic 2015 Lesson 34: Creating Databases - Learn Visual Basic Programming \u2013 VB.NET, VBA &amp; Classic VB","isPartOf":{"@id":"https:\/\/www.vbtutor.net\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson34.html#primaryimage"},"image":{"@id":"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson34.html#primaryimage"},"thumbnailUrl":"https:\/\/www.vbtutor.net\/wordpress\/wp-content\/uploads\/2014\/02\/vb2013_figure33.1.jpg","datePublished":"2015-10-27T06:59:28+00:00","dateModified":"2018-06-22T14:22:40+00:00","description":"This article discusses how to create databases in visual basic 2015","breadcrumb":{"@id":"http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson34.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.vbtutor.net\/vb2015\/vb2015_lesson34.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.vbtutor.net\/vb2015\/vb2015_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\/vb2015\/vb2015_lesson34.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vbtutor.net\/"},{"@type":"ListItem","position":2,"name":"Visual Basic 2015 Lesson 34: Creating Databases"}]},{"@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\/7297","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=7297"}],"version-history":[{"count":30,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/7297\/revisions"}],"predecessor-version":[{"id":13050,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/pages\/7297\/revisions\/13050"}],"wp:attachment":[{"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/media?parent=7297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/categories?post=7297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vbtutor.net\/index.php\/wp-json\/wp\/v2\/tags?post=7297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}