Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Help! - Unable to connect

Author  Topic 

adya
Starting Member

31 Posts

Posted - 2008-10-12 : 19:04:58
Hi

I am new to sql server and asp.net and coudn't work my way around this.

I am trying to connect a database connection between database in sql server enterprise edition to asp.net 3.5. my server explorer shows me the connection and also displys the membership, roles and other tables created after running the aspnet_regsql cmd tool. But, when i try and run the website administration tool and establish the roles and users, it gives me a error..

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Unable to connect to SQL Server database.


I have used the following connection string in my web.config:
<connectionStrings>
<add name="RLMS.Properties.Settings.myDBConn" connectionString="Data Source=YOUR-3A4470EBC6;Initial Catalog=ageis;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>

For the time being, i just want to establish roles for the website and not retrieve any data.

I have tried establishing connection multiple number of times, but it still exists.

Any help would be appreciated.


Thanx in advance!

Adya

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-10-12 : 19:20:40
For connection string see
www.connnectionstring.com

the above code you are using means that you are using a trusted connection.

To add the username or password, use

<connectionStrings>
<add name="myConnectionString" connectionString="Server=000.000.000.00,1433;Database=cellulantsms;Uid=username;Pwd=password;"
providerName="System.Data.SqlClient" />
</connectionStrings>

Go to Top of Page

adya
Starting Member

31 Posts

Posted - 2008-10-12 : 19:57:49
Hi Afrika
I checked my connections tring, allowed sql server to allow remote connections and made a new database again and attached it.
But, on running website administration tool, i recieved an error in machine.config. I had to change it to make it finally run properly.It had wrong connection string name.

But, may i ask what is excatly machine.config

Thanks for your help!

Adya
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-10-12 : 20:11:55
these might help you understand better


http://msdn.microsoft.com/en-us/library/ms229697.aspx
http://msdn.microsoft.com/en-us/library/1xtk877y.aspx
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-10-12 : 20:30:40
Next time, paste your error message here. And the script you are using, to help understand you better

Go to Top of Page

adya
Starting Member

31 Posts

Posted - 2008-10-13 : 12:12:26
Hey Afrika

Thanks for your help, i really appreciate it!

Will post d code next time, i get stuck!

Thanks again!

Go to Top of Page
   

- Advertisement -