Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL database connection: first string to connect from a c# page

Posted on 2009-07-07
1
Medium Priority
?
588 Views
Last Modified: 2012-05-07
Hi all,

I am attempting to create and test my first string connection to a sql server test database, without success.  

I will provide here all the information to connect the database here, and will change the credentials later.  Anyway, this is just a test database.

I created this test database on godaddy.com.  I entered the name of the database and provided a password.  The string they then recommend is:  

Data Source=testtest12345.db.2653863.hostedresource.com; Initial Catalog=testtest12345; User ID=testtest12345; Password='your password';

My password is: Test1Test  

I tried in the web.config, inside the <connectionstrings>, to add this line:

<add name="testfirststring" connectionString="Data Source=testtest12345.db.2653863.hostedresource.com; Initial Catalog=testtest12345; User ID=testtest12345; Password=Test1Test;" providerName="System.Data.SqlClient"/>

Then, from visual studio, I dragged and droped a SqlDataSource, in the body of my default.aspx page, which generated the line:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>

 Then, in design view, I right click and chose Configure data source.   I choose my testfirststring connection which is available in the menu, and when i press next, i get the error message shown in the image below.  I really do not know what I can do.

Anyone would know what I am doing wrong?  Anyone is able to connect to my database?  

Thanks!  I am clueless here.
Error message from Visual Studio:  "Database schema could not be retrieved from this connection..."

Open in new window

errormessage.jpg
0
Comment
Question by:ThanksWelcome
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
ThanksWelcome earned 0 total points
ID: 24797673
I found the problem after half a day of research:  the database was not setup to be available remotely, so I could not test the connection remotely, which I tried to do.

I now have the connection working.  Thanks!

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question