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
 General SQL Server Forums
 New to SQL Server Programming
 connection string help

Author  Topic 

onlinenovice
Starting Member

7 Posts

Posted - 2008-05-06 : 15:11:35
Hello all,

Please help me as i am not able to connect to my database

I have my databse in datab directory

and this is my connection string

<add name="Connstrmy" connectionString="my server ; AttachDbFilename="datadirectory\test.mdf";uid=username; pwd=passowrd;"

providerName="System.Data.SqlClient" />



hosting people have said that I am using uid and password for databse and not of server.

i have to add user id and password for server also

how do i do that?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-06 : 15:13:45
http://www.connectionstrings.com/?carrier=sqlserver2005

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

onlinenovice
Starting Member

7 Posts

Posted - 2008-05-06 : 16:02:43
hi i have seen that site but not able to get one correct con string for myself.

how do i add server user id and password ?
and is my contring wrong?

when i use it on my local comp it works fine// changing server name and removing uid and pwd
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-06 : 16:05:24
Why haven't you posted your error?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

onlinenovice
Starting Member

7 Posts

Posted - 2008-05-06 : 16:43:30
here is the error

Cannot open database "test.mdf" requested by the login. The login failed.
Login failed for user 'gophotool.com'.
Go to Top of Page

onlinenovice
Starting Member

7 Posts

Posted - 2008-05-06 : 16:48:42
i have been tring to search all kinds of help but not able to get any asnwer for the same.
i have been given 2 user id and password
1 for sql server and one for database

when i use sql server user id and password it thriws error that login failed for user (username)

but when i manually login to sql server there is one databse for me with a different name (blank)
in my connection string when i give name of that databse this conneciton string works perfectly only werro i get is becasue of tbale name which is not available in the databse( on sql server created by my host for me)

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-06 : 16:49:59
Your error has nothing to do with your connection string. Do you have enough permissions to modify the default database of "username"? If not, ask your host to fix it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

onlinenovice
Starting Member

7 Posts

Posted - 2008-05-06 : 16:52:37
sir,
i have asked for the same but they reply

check your code problem is with your code you only using databse username and password you should use server username and password

but i will once again request them for the same

thankyou for your instant help
Go to Top of Page

onlinenovice
Starting Member

7 Posts

Posted - 2008-05-06 : 17:00:18
Sir for your reference this is the reply i got for this error from myhost

1: u can't create any database inside 1 database, if u need more Db, then let us know
2: gophotool.com : it's having purely coding issue

Please check ur coding once..
u can contact any of ur dynamic developer for this DB error in coding
Go to Top of Page

onlinenovice
Starting Member

7 Posts

Posted - 2008-05-07 : 08:38:17
no help sir
they suggested me to contact dynamic developer ( sarcastic remark)
and they still believe that its connecion string problem and no problem at their end.

can you please suggest that how do i create .sql file for my databse with backup of all the data in it

from sql server management 9 express edition
when i right click on my data file>> tak generate script.

a script is generated without data of my database
but sql server does not recognize dbo keyword which is in the script.

please help me if you know of free utility which cn create databse script and its backup.


thankyou very very much for all your help
Go to Top of Page
   

- Advertisement -