| Author |
Topic |
|
midi25
Starting Member
24 Posts |
Posted - 2009-01-07 : 10:47:55
|
| Hi I have a connection string to my DB and when I add it to the web config page of my application all I get is problems. I want to be say with surety that my connection string is ok. ie rule out the connection as a problem. How can I test to see if my connection has been established in sql. ? Can it be done with a query? Thanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-07 : 10:53:17
|
| whats the error you get when you include it in webconfig? |
 |
|
|
revdnrdy
Posting Yak Master
220 Posts |
Posted - 2009-01-07 : 12:28:09
|
| Just to make sure.. does your syntax in web config look like this?Note I am presuming a .NET environment<configuration> <appSettings> <add key="ConnectionString" value="server=YourServerName;database=Northwind;uid=userID;password=secret;" /> </appSettings></configuration>Also as already posted you could tell us what the reported error is.It may also be the case that you have to restart the web server once you update the config file but I am not sure how your environment is setup. I know that apache web server requires this...r&r |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
midi25
Starting Member
24 Posts |
Posted - 2009-01-07 : 13:42:05
|
| The application that I am using has a section like this in the web config. Yes it is a .net environment. <configuration><appSettings><add key="ConnectionString"value="server=serve;database=jb;uid=john;password=bob;Intergrated Security=True;" /></appSettings></configuration>I,m not getting any meaningful errors on the error display page. All it tells me is to turn on remote errors or view the page on the local server. ie: mode="RemoteOnly" or "Off" |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
revdnrdy
Posting Yak Master
220 Posts |
Posted - 2009-01-07 : 14:06:36
|
| Ok shot in the dark...Intergrated Security=Trueis mis-spelled. Did you type that into your post to us or copy it in from the webconfig file? Intergrated should be spelled as IntegratedI would think it matters but again a shot in the dark..r&r |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
midi25
Starting Member
24 Posts |
Posted - 2009-01-07 : 16:06:36
|
| Sorry i meant Integrated that was a typo. I am using a login that I created myself for the database. So its SQL Authentication. I assume. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
midi25
Starting Member
24 Posts |
Posted - 2009-01-07 : 16:28:05
|
| I am using a login that I created in the db string. eg: uid=john;pwd=123 so is this sql authentication? Thanks |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
midi25
Starting Member
24 Posts |
Posted - 2009-01-07 : 17:58:10
|
| Thats sites not too helpful for newbies. are there any other sites that explain about all the sql connection string parameter meanings? thanks |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
midi25
Starting Member
24 Posts |
Posted - 2009-01-07 : 18:44:26
|
| grrr. I just cant get this to connect man. I have my SQL Express instance set to mixed mode. I have a database called abc i have created a login for the db called john I have allowed remote connections through surface area I have started the sql browser service I can connect and successfully test the connection by creating a dsn using all the supplied details. Finally I am using the following string in my web config. Server=Pluto\SQLEXPRESS;database=abc;uid=john;pwd=123;What could be wrong? Thanks |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
midi25
Starting Member
24 Posts |
Posted - 2009-01-09 : 05:29:24
|
| I got to the bottom of this. The application instructions were poorly written. In the connection string the example talked about using SQL authentication using Trusted Connection=True I recreated the db and set the string in the web.config file to use the sql login for the db. And then set trusted connection to false. It worked and the data is now being written to the tables. Basically the instructions that I inherited where flawed. Something that I will make aware to the relevant people. Thanks for the help. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|