Add Referece Sql ,after installed,Visual Studio 2010

Posted by Raja_89 under Visual Studio on 8/22/2013 | Points: 10 | Views : 1722 | Status : [Member] | Replies : 4
Hai

I have installed a Visual Studio 2010 .

Now i installed SQL Server 2005

How can i use that database[Sql ] in my web application

Could i reinstall the Visual studio 2010 to use that data



Regards




Responses

Posted by: Bandi on: 8/22/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer "Connecting to the Database in a Microsoft SQL Server 2000 or 2005 Database Server" in the following link
http://msdn.microsoft.com/en-us/library/aa581778.aspx
Server Explorer --> Right click on "Data Connections" --> you can create new database by using "Create New SQL Server Database"/ you can access already existed database by using "Add Connection"

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kmandapalli on: 8/22/2013 [Member] Silver | Points: 25

Up
0
Down
Hi,

U will have a connection string for the database that you are using in SequalServer.
Declare that connection string in your web.config file which is present in you web application.

For Example:
My ConnectionString is
"Data Source=PRIMEDB01\SQL2008;Initial Catalog=Primedb02;User ID=sa;Password=007"

In my web.config file il declare my connection as below:

<connectionStrings>
<add name="SqlConnection"
connectionString="Data Source=PRIMEDB01\SQL2008;Initial Catalog=Primedb02;User ID=sa;Password=007"/>
</connectionStrings>

In your application .cs page,
you can use your sequal connection as,

SqlConnection con = new SqlConnection(ConfigurationManager.connectionStrings["SqlConnection"].connectionString());

Thats it...

Mark as answer if satisfied.....

Thnak You,
Kavya Shree M.

Kavya Shree Mandapalli

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/22/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Have you connected to SQL Server from Visual studio?
If you got solution mark it as answer

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: WPF_G on: 11/18/2013 [Member] Starter | Points: 25

Up
0
Down
If you want to know more about Visual Studio you can download here a FREE eBook : http://www.tekkiebooks.com/campaign/freebook/dotnetfunda_09
LEARN step by step how to install Visual Studio 2012 on Windows 8. Use it as a quick reference or a standard how to document for your development team. Simplify your work and gain time!

Good luck in creating amazing applications!

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response