How To Ideas | How To Articles | How To Tutorials


3

How To Create Data Connection In Visual Studio


Creating a data connection is very important and is much needed task, specially when you create applications or websites which communicate with external Data Sources like SQL Server, Oracle, etc. In this article i will show you how to create a data connection in Visual Studio. I will be using Visual Studio 2010 Ultimate edition and Microsoft SQL Server 2008 R2 to explain you the process.

Instructions:

  1. Create a New project or open any Other project you have.
  2. Go To the Server Explorer Window, If you don’t see any, then you can go to “View” menu and choose “Server Explorer” from there.1
  3. In “Server Explorer” Window, right click on “Data Connections” and choose “Add Connection”.
    2
  4. It will open “Add Connection” dialogue.
  5. Select the “Data Source” provider, by clicking the Change icon next to “Data Source:” field and choose your Data Source from the list provided in next Window. As, I mentioned that i will be creating a connection with SQL Server, So i will choose “Microsoft SQL Server (SQL Client)”.3
  6. After that choose your “Server Name”. This is generally the name of your Computer. You can click on “Refresh” button, which will load all the Servers present and you can select your server from the drop down list. If you don’t find any Server in that list, try be just typing your Server name there instead of selecting from drop down list.

    Incoming search terms:

    • connectivity in visual studio (1)
    • sql server c# ms visual studio 2010 (1)
    • visual studio 2010 ultimate tutorial (1)
    • visual studio ms sql 2008 r2 tutorial (1)
Filed in: Visual Studio Tags: , , , , , , , , , ,

3 Responses to "How To Create Data Connection In Visual Studio"

  1. Tajinder says:

    hi rohit …. can you tell me how to connect through oracle server ??

  2. Rohit says:

    Tajinder, I will recommend you to use only Microsoft products while working in .NET. Because you will get built in support for every tool. As far as Oracle is concerned, Oracle too don’t provide direct support to use Oracle with .NET, because they have their own Programming language which is JAVA.

    But if you are sure that you want to continue with ORACLE in .NET, then you will need ODP.NET driver. Its a wrapper for Oracle in .NET. You have to search for this driver, download and then Instal it. When you are done installing this driver in your system, then you have to take its reference in your Project for the classes this driver have in your .NET project.

    This driver contains similar namespaces to SQL Server, to use in .NET. like you have Oracle.DataAccess.Client namespace which will work exactly same as System.Data.SqlClient. This namespace provides you number of classes like OracleConnection, OracleCommand, OracleDataAdapter, etc. to get full connectivity with Oracle.

  3. shane says:

    Yes, you need Oracle Date Provider (ODP) for making connections with Oracle in C# or any other .NET language. Here is a link to a good article which you may like

    http://www.codeproject.com/KB/database/C__Instant_Oracle.aspx

    and here is a little discussion about this topic

    http://social.msdn.microsoft.com/forums/en-us/csharpgeneral/thread/435A125E-7A0E-4F81-978A-750B25B597A0.

    Hope it helps.



© 4390 How To Ideas. All rights reserved.
Proudly designed by Theme Junkie.