Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 2 - How to Use Data Sources with Databases
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

How to Use Data Sources with Databases
By: Murach Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2006-11-02

    Table of Contents:
  • How to Use Data Sources with Databases
  • How to start the Data Source Configuration Wizard
  • How to choose a data source type
  • How to create a connection to a database
  • How to choose database objects for a data source

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    How to Use Data Sources with Databases - How to start the Data Source Configuration Wizard


    (Page 2 of 5 )

    You can use the Data Source Configuration Wizard to create a data source for an application. Figure 14-2 shows the first step of this wizard. Since the steps of this wizard are mostly self-explanatory, this chapter only shows the ones that need some additional explanation. In particular, figure 14-3 shows how to create a new connection to a database, and figure 14-4 shows how to select the database objects that will be included in the dataset for the data source.

    If your project doesn’t already contain a data source, you can start the Data Source Configuration Wizard by clicking the Add New Data Source link that’s in the Data Sources window. However, if your project already contains a data source, the Data Sources window will display a data source and this link won’t be available. In that case, you can start the Data Source Configuration Wizard by selecting the Add New Data Source command from the Data menu.

    You can also start the Data Source Configuration Wizard by adding a SQL Server or Access database file to the project. You may want to do that if the application is for a single user. That way, the database can easily be distributed with the application as described in chapter 25.

    If you add a database file to your project, you should know that by default, that file is copied to the output directory for the project every time the project is built. (The output directory is the directory where the executable file for the application is stored.) Then, when you run the application, the application works with the copy of the database file in the output directory. That means that any changes that you make to the database aren’t applied to the database file in the project directory. And each time you rebuild the application, the database in the output directory is overwritten by the unchanged database in the project directory so you’re back to the original version of the database.

    If you want to change the way this works, you can select the database file in the Solution Explorer and change its “Copy to Output Directory” property from “Copy always” to “Copy if newer.” Then, the database file in the output directory won’t be overwritten unless the database file in the project directory contains more current data.

    More Visual Basic.NET Articles
    More By Murach Publishing


       · This article is an excerpt from the book "Murach's Visual Basic 2005," published by...
     

    Buy this book now. This article is excerpted from chapter 14 of the book Murach's Visual Basic 2005, written by Anne Boehm (Murach, 2006; ISBN: 1890774383). Check it out today at your favorite bookstore. Buy this book now.

    VISUAL BASIC.NET ARTICLES

    - Working with Classes and Properties for Game...
    - Working with Loops, Arrays, and Collections ...
    - Learning Loops in VB.NET for Game Development
    - Learning VB.NET: Working with Variables, Con...
    - The Basics of VB.NET Through Text Game Devel...
    - Learning VB.NET Through Text Game Development
    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...
    - Programmatically Controlling Windows Fax Ser...
    - Focusing on Forms and Menus in Visual Basic





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway