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





View Nannette  Thacker's profile on LinkedIn

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

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

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

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

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

newbie said:

Thanks for posting this article.

# November 1, 2009 4:58 PM

Brittany- a newbie! said:

NANNETTE!

AWESOME Instructions! Thank you.

# December 11, 2009 1:19 PM

Nikki said:

Its was vry nice for newbies...it helped me alot.. But can u please explain me about windows authentication in "Add connection" dialog Box.How could v know about server name??plz explain me

# February 3, 2010 8:28 AM

Lolo said:

THX nannette! I'm using Web Developer for 2 years and never realized that remote connection is so simple lol :D

# February 5, 2010 8:30 AM

scott said:

thanks, i needed to this!

# March 18, 2010 10:34 PM

Baiju EP said:

This topic was very helpfull to me as i am a new in asp.net+sql. many many thanks. more topics may ple be posted like this in aspx+SQL database

# May 5, 2010 12:40 PM

Karunesh said:

I am still not getting access to ramote database.

# May 7, 2010 1:15 PM

Adelson, Sheldon G. said:

I like instructions that are step by step. In a past life I was required to write instructions for colleague with limited knowledge. I have also had the pleasure of knowing many "Computer People". Most lack tact, attention to details, respect and valuable communication skills. This could be why most are lazy, over weight, lonely and possess very strong left arm.

Keep up the good work.

# May 26, 2010 2:50 PM

Tom said:

Thanks Nannette. Much appreciated.

# July 9, 2010 8:24 AM

laguilar said:

still nowadays good job!

# August 23, 2010 6:51 PM

gaurav said:

tis goog.bt it needed some experience about programming also.........

thanks

# September 28, 2010 5:16 AM

Jesus said:

Thank you very much, I've been having tons of problems with a remote database in SQL Server and couldn't find the cause. Without you I would have never been able to connect to the database and find that the original data was a spanish Ñ in the data, since I was receiving it already altered by the C++ connector encoding.

Thanks a lot, there aren't many posts like this one, useful for a newbie like me.

# December 2, 2010 1:58 PM

Rasika said:

Thanks a lot. this really good..

# January 9, 2011 12:44 PM

David said:

You can use SQL Server Management Studio Express to create a database and tables on a Remote SQL Server.

David

# February 7, 2011 1:43 PM

Christine said:

Hiii,

thnx for the post but I don`t know why these steps are not working with me.

I just choose my pc as the server and check "use sql authentication"

enter in user name "sa" and password"mypassword"

and then Login failed for sa user.I wonder why this happens with me

# February 15, 2011 7:45 PM

Luis said:

Disculpa, no podrias poner el codigo de la conexion a otra base de datos remota desde visual basic, creo que eso ayudaria a muchos, muchas gracias.

Atte. Luis

Estudiante de Informatica

COMPUTRONIC

# February 21, 2011 5:31 PM

bharath said:

very useful, thanks

# March 8, 2011 1:14 AM

Suresh said:

Thanks this is helpful to me!

# March 26, 2011 5:27 AM

amit pandey 9755153748 said:

thanks a lot for tips its very good.

# March 30, 2011 1:36 AM

sunil jadhav said:

hi i have created one database project where i want to connect sql server 2000 database from other system from local lan using odbc connection in vb 6.0 please help me

# March 31, 2011 12:40 AM

Yoshiyahu said:

Thanks! This was just what I needed to figure out that I needed to instal Microsoft SQL Server.

# May 5, 2011 7:09 PM

John said:

Thanks for the post - VERY helpful for this newbie!

MUCH appreciated. !

# May 12, 2011 2:52 PM

Sampath said:

Thanks!, This is helpful

# May 14, 2011 12:11 PM

anni said:

thanks a lot sir.great n helpful 2..

# July 20, 2011 8:56 AM

nishant said:

thnx dis really helpful

# September 17, 2011 2:13 AM

Shamy said:

Really its very nice article.

And this is what I searched in google.

Thank you very much

# September 27, 2011 1:18 PM

Rickz said:

@Nannette

Thanx dude it totally helpd me

Thanx a lot

# October 7, 2011 5:00 AM

Anil V. Shejale said:

Thank you for posting this how-to. I used it today to connect to a remote database, the first time ever. Bliss. Pride. You the man though! :-)

Please ignore those who critise you. You're doing good work.

# October 18, 2011 8:34 PM

skran said:

I found this information very helpfull!

Thanks!

# October 31, 2011 6:44 AM

joy said:

hi Nannette, ur post about db connection is quite useful but I need codes for a submit button in vwd 2008 to submit data to Mssql express 2005. it is quite urgent. ur help is appreciated.

please mail to oliottah@hotmail.com

# November 9, 2011 9:05 PM

Kenneth said:

I will check this one and I will update the progress guys.

Kenneth

# November 12, 2011 5:36 AM

Sam said:

That was really a great..I appreciate nannette for this post n for all the effort she put in takin the snapshots n posting them..N i promise that ur snapshots gave me more great idea of how to connect to the database ..Keep posting Nannnette..U rock ..All the very Best

# December 7, 2011 2:12 PM

Trick said:

Thank you Nannette. Forgot this method. LOL

# December 27, 2011 1:37 PM

Madhu said:

I've a question.

I have SQL Server 2000 installed on client machine and my team is writing scripts using PL/SQL .

We dont want to install SQL Server 2000 in everyone's pc and create database to write scripts.

Is there any tool which connect to client machine's sql server 2000 and access there database to write scripts.

Thank u.

# January 9, 2012 4:23 AM

nannette said:

Madhu,

I use SQL Server Management Studio. But you can also use Visual Studio, such as VS 2010. Use the Server Explorer tab, select the existing or create a new Data Connection. Go to the Stored Procedure folder of the database, and select to "Add New Stored Procedure."

Nannette

# January 9, 2012 3:45 PM

Madhu said:

Thank you so much.

# January 10, 2012 3:54 AM

Friendofghost said:

thanks. no matter what they say, keep sharing.

# January 14, 2012 6:30 PM

Rakesh said:

Thankx these snapshot so helpfull for me.

# February 23, 2012 10:08 AM

rudresh said:

its good article.

# February 27, 2012 5:59 AM

Alex said:

GREAT! GREAT!GREAT!GREAT!GREAT!GREAT!GREAT!

# October 12, 2012 6:15 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)