Home / Uncategorized / How to connect database SQL server 2008 with visual studio 2010

How to connect database SQL server 2008 with visual studio 2010

SQL server

SQL server very critical function for every online server server provider. In computer software development , The database create and database design  is most important part .Any software must have database , It has to design and connect it with a interfacing IDE (Integrated Development Environment) . Desktop based software development and web based software development must have to connect database . Database connection is the major issue and a problem in computer software programming . In this session we have described about database connection with Visual Studio 2010 in C sharp language .If we can not connect database properly , it must be create problem in the time while we want to create an EXE file for installing the database software in our real application .


Here the database name is DUCT.mdf and it saved in drive D and the folder of the database name is db. A Gateway class is  used for handling the connection string . Here also a Gateway constructor  for initialize the class. It is format of object oriented programming and also used for tips and tricks for software development using computer.



using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;


namespace DuckDesign.Gateway


public class Gateway


string connectionString = @”server = .\D:\db\DUCT.mdf; integrated security = SSPI;”;

public string GetConnection()


return connectionString;





Check Also

computer performance

Computer performance Identifying the problem how to solve it

How can you improve your computer performance Increasing Computer performance is an effective issue in …


  1. Briaillnce for free; your parents must be a sweetheart and a certified genius.

  2. I just want to say I am just newbie to blogs and absolutely liked your web site. Very likely I’m likely to bookmark your website . You surely have incredible writings. With thanks for revealing your web-site.

  3. Here are some variables which you can contemplate while purchasing Garcinia
    Cambogia extract.

  4. Hello admin !! I read your blog everyday and i must say you have hi quality
    posts here. Your blog deserves to go viral. You
    need initial boost only. How to go viral fast? Search for; forbesden’s

Leave a Reply

Your email address will not be published. Required fields are marked *