Nannette Thacker ShiningStar.net

ASP.net Web Application Development

Sponsors

News

See all Blog Posts by Nannette.

Nannette Thacker, consultant and owner of Shining Star Services LLC, specializes in development of custom dynamic database driven web applications utilizing ASP.net technologies. Nannette has been developing ASP sites since 1997. Nannette has written numerous articles on web development techniques and tutorials.

Nannette is the owner and developer of ChristianSinglesDating.com.

 Subscribe in a reader




Creating a Database Connection to a Remote SQL Server Database within Visual Web Developer

By Nannette Thacker

Step-by-step instructions for creating a database connection to a remote SQL Server Database, using Visual Web Developer.

  1. Go to the View menu item and select Database Explorer.

  2. Depending on how you have your Visual Web Developer interface setup, go to the Solution Explorer, and at the bottom you will see a tab for Database Explorer. Click that. 



  3. You will see the "Data Connections" available in the Database Explorer. We currently have none displaying.

  4. Right click in the Database Explorer area and select "Add Connection..." 



  5. This will bring up the Add Connection dialog box. Select the "Change" button. 



  6. In our example, we are connecting to a SQL Server database, so select the "Microsoft SQL Server" Data source option as well as the ".NET Framework Data Provider for SQL Server" Data provider. 



  7. Select "OK" to return to the "Add Connection" dialog. Put in the IP address or server name for your database. In our case, we use Windows Authentication, but you may optionally input a User Name and Password and select "Use SQL Server Authentication." Use the drop down list to "Connect to a database" and "Select or enter a database name:" Select "Test Connection" to make sure you have it setup properly. Then "OK." 



  8. Now you may use the Database Explorer tab to view your tables and data. 





Although you may create and alter a SQL Server .mdf database within your project, Visual Web Developer doesn't support opening a table definition or adding a new table from your SQL Server 2000 database. But it does allow "Show Table Data." It allows you to see the names of your stored procedures, but not to edit or view their content, just the properties. It is very limited, but you may wish to have it just for those purposes.

If you don't yet have the new Visual Studio, but do have Visual Interdev, perhaps for use with your ASP Classic development sites, you may utilize VI to manipulate your SQL Server databases remotely.

May your dreams be in ASP.net!

Nannette Thacker

Comments

Anon said:

Is this a joke?

Is this what passes for content on weblogs.asp.net now?

# February 17, 2008 11:19 PM

Josh said:

Was this really worth posting?

# February 17, 2008 11:37 PM

nannette said:

Josh Anon,

It's fairly obvious that I put effort into my blog. I think some people seem to forget that the internet is full of newbies learning how to program and use the tools. I like to provide step by step instructions to aid others in learning things that you evidentally feel are uselessly beneath your level. Just congratulate yourself that you're beyond that stage and move on.

Nannette

# February 18, 2008 2:01 AM

WebReservoir said:

@ Josh + @ Anon

If you were smart and experienced enough, what made you read this blog. You should have easily neglected it.

It takes time and effort both to take the snapshots and to post it.

Pl. take the positive side that nannette is trying to help the newbies.

Carry on nannette, few odd remarks should not change your attitude.

P.S.:- it would be nice, if you can explain how to create a database on the remote server, and how to take the backups.

All this should be through Visual Web Developer.

Would it be more easy through control panels or VWD..?

Pl.guide us.

WebReservoir

# February 18, 2008 2:37 AM

nannette said:

WebReservoir,

It is my understanding that VWD doesn't support creating a database or making backups on the remote server. At least when I work with VWD on my remote database, it is very limited and doesn't allow manipulation, just viewing.

Anyone else know for certain?

I do have an upcoming article coming out on 4guysfromrolla that will demonstrate how to create an .mdf database in VWD, but that's not what you're asking.

Thanks for your kind words WebReservoir.

Nannnette

# February 18, 2008 11:10 AM

Travis said:

Nannette ignore the trolls.  Great article for the beginners out there.

# February 18, 2008 3:47 PM

VD said:

I'm a newbie and this was useful as it's what I searched for in Google.

# February 20, 2008 7:50 PM

John said:

I also appreciated the beginners step-by-step.  Not all of us have been programming .Net for years.  This post was able to get me jump started on a project I'd been putting off because I'd had problems connecting to a remote DB.  Thanks for all your work.

# February 21, 2008 5:13 PM

Mark Wisecarver said:

Nothing wrong with what you provided Nannette.

Good job mate.

# February 28, 2008 10:25 AM

G Clark said:

Nannette,thanks for the tip.  I've been doing application development for decades (I won't mention how many) and have had to learn and use dozens of languages and development tools.  In this time and place, I am a newbie, and I appreciate your efforts.

# March 31, 2008 1:36 PM

pills said:

this was very useful to me

# April 12, 2008 3:10 PM

Adam Roessler said:

Nannette,

As a newbie to asp.net, I appreciate your article.  I am new to VWD and was uncertain how to make my connection.

Now I'm working with my data and learning how to represent it in VWD.

Thanks a bunch!

# April 16, 2008 5:23 PM

Brady said:

I'm a newbies myself and this helped me out quite well

Nice one!

# May 29, 2008 4:05 AM

Eldon said:

Great post for us newbies it is very much appreciated that the more experienced will still take the time to do something like this.  

# July 28, 2008 2:28 PM

Santy said:

Very Good work. It is help full for anyone who want to quickly know how to connect to remote sql server. Keep up the good work. And hope that others will follow your example instead of criticizing it.

# September 15, 2008 8:33 AM

Dan said:

Nannette,

Thanks again, it was appreciated here too.

Dan

# October 14, 2008 3:08 PM

Jordan said:

I agree, great post.

# November 20, 2008 10:05 AM

Liste said:

Great post.  It took me hours to figure this one out, and here I find it written out in simple language, and easy to understand.

I would really appreciate knowing how to edit the database (add tables, etc.), though.  Any suggestions, links?  Anything?  Thanks!

And thank you for the wonderful post!  Keep it up!

# December 9, 2008 11:03 AM

Bobberino1 said:

Great Post.  Thanks for taking the time

# December 9, 2008 10:00 PM

Rhys said:

Thanks Nanette, very helpful!

# December 21, 2008 8:01 PM

Charles Broadbent said:

Man, this tutorial was such a waste of time. I can't believe this made it to weblogs.

# January 22, 2009 3:04 PM

nannette said:

Thanks Charles, for your kind words.

# January 23, 2009 11:57 AM

Mark said:

This was very helpful to me. I am just starting out and this answered my question exactly! Thank you so much Nannette, you really helped me out today.

# February 4, 2009 10:47 PM

Jason said:

Nannette, When you say VWD, are you referring to the full version, or VWD Express 2008. It seems that your snapshots look like what I'm using with VWDexpress08, but I'm having trouble using an IP address to connect to my remote server, that contains our SQL database. Any suggestions on the exact method for specifying the server name? Is is only the IP address that should be entered in that field?

Thanks!

# February 11, 2009 11:12 AM

nannette said:

Jason,

I believe in this example I was using Visual Web Developer 2005 Express Edition.

In all of my instances, I do simply use the IP address.

Have you made sure you can access this database remotely from any other type of method you've successfully used? Perhaps you need to grant permissions in your firewall.

In my situation, I use windows authentication, so the user I log in with must also have an administrative account on the remote SQL Server box.

You might try using a login and password and see if that works. Then if so, perhaps track down why the windows authentication doesn't work.

Nannette

# February 11, 2009 11:47 AM

KANG Ghee Keong said:

Good simple post actually, I found it useful, being new to VWD 2008 Express.  And your note that it does not allow the user to Create a new Database from within definitely saved me a lot of hair scratched off my head.

Now the next question is, then how do you actually Create a new Database then (since I have no other database administration tools at the moment, what is recommended)?

SIDE NOTE:

Also, after I chose data source to be ".NET Framework Data Provider for SQL Server", the Server Name drop down box automatically gave me a list of the server instances I have installed locally, so there is no need to type in the IP address.

# March 14, 2009 10:18 AM

nannette said:

Kang,

>>how do you actually Create a new Database then

I guess what I meant is, you can create a local .mdf database and alter it. But you can not create a remote SQL Server 2000, 2005 or 2008 database on a remote server from within VWD Express.

From what you said, sounds like you're working locally, so that should work for you.

# March 17, 2009 2:13 PM

anodaNewbie said:

yea, useful post indeed. its exactly what i needed to know. thanks a lot.

# April 1, 2009 5:51 AM

Karim said:

Thank you for the post.

This was very usefull. I have been using ASP.NET for a couple of years now, so I don't consider myself newbie. But because I am only connecting to a database on our server I didn't know how to do it on a remote db. I learned how now, although it's very easy.

Thanx again

# April 1, 2009 11:51 AM

Michael Darren said:

Great post. Thank you.

# April 11, 2009 7:50 PM

Lucy said:

Thanks for the post.  I was extremely frustrated trying to do this as a newbie. keep on posting for us, we appreciate it.

# April 12, 2009 12:22 PM

Thai said:

Thank you.

# April 15, 2009 8:59 AM

clausont said:

Thanks for this tutorial. I am a newbie and it is great to find tutorials for beginners like me - especially where they are complete with snapshots.

Well done.

# April 29, 2009 3:58 PM

jb said:

A good one, The ones who dont think it worthwhile could ignore this. But they dont have to discourge anyone. let em all come upto ur level.

# April 30, 2009 1:48 AM

Charl said:

This article helped me to get SQL server 2008 running on my computer. Nannette put a great deal of effort into this article. Please ignore all the negative comments. Thank you

# June 7, 2009 3:23 AM

suz said:

Hi

I followed steps you provided ,but i'm not able to connect to remote database by giving ip address.I'm gettin error as remote connections is not allowed.But i had enabled that one.

# June 9, 2009 6:35 AM

suz said:

Hi

I followed steps you provided ,but i'm not able to connect to remote database by giving ip address.I'm gettin error as remote connections is not allowed.But i had enabled that one.

# June 9, 2009 6:35 AM

Gunnar N. said:

Very good!

# August 2, 2009 5:05 AM

NewProgrammer said:

You have use IP address but i want to enter server name.How to know what is my server name.I m using visual studio 2008.

# August 26, 2009 9:31 AM

Rajeev said:

Nice one

# October 8, 2009 8:24 AM

Creating a Database Connection to a Remote SQL Server Database within Visual Web Developer - Affordable Web Developer - Just another WordPress weblog on Affordable open source web development. said:

Pingback from  Creating a Database Connection to a Remote SQL Server Database within Visual Web Developer - Affordable Web Developer - Just another WordPress weblog on Affordable open source web development.

# October 20, 2009 4:00 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)