Home > Archive > MS SQL Server > November 2006 > sql express connection string









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author sql express connection string
raju

2006-11-09, 5:16 am

Hai,

We created one application, with deployment. When we install the
application on another machine, it will attach a database in sqlexpress
instance. For eg. c:\Programfiles\ours
oftwarename\kmsdb.mdf.

Now i am having one more webservice running on that machine as
dll(not webservice source code). In this web service i am reading that
database values. But the connection string is giving some error
message.

So, can anybody tell me, what type of connection string i have to
provide.


Regards,
Raju.

Uri Dimant

2006-11-09, 5:16 am

raju
> database values. But the connection string is giving some error
> message.

Are you kidding? Do you think we have to know what is the error you are
getting?

Can you show the error's message?




"raju" <ponnurajs@gmail.com> wrote in message
news:1163061224.836777.35550@k70g2000cwa.googlegroups.com...
> Hai,
>
> We created one application, with deployment. When we install the
> application on another machine, it will attach a database in sqlexpress
> instance. For eg. c:\Programfiles\ours
oftwarename\kmsdb.mdf.
>
> Now i am having one more webservice running on that machine as
> dll(not webservice source code). In this web service i am reading that
> database values. But the connection string is giving some error
> message.
>
> So, can anybody tell me, what type of connection string i have to
> provide.
>
>
> Regards,
> Raju.
>



raju

2006-11-09, 5:16 am

Hai,

Thanks for you response.

Sorry, I forget !

actually my coding is

sCon = "Server = ./SqlExpress;Database =KMSDB;Integrated Security =
SSPI;"

gsCon = New SqlClient.SqlConnection(sCon)
If gsCon.State = ConnectionState.Closed Then
gsCon.Open()
End If

sQuery = "SELECT KeyCode 'Key Code',Status
'Status',UserCode 'User Code',JobCode 'JobCode' " & _
" FROM KeyHolders"
oDaKeyHolders = New SqlClient. SqlDataAdapter(sQuer
y, gsCon)
oDaKeyHolders.Fill(oDsKeyHolders)


For this I am getting the error is

" An error has occurred while establishing a connection to
the server. When connecting to SQL Server 2005, this failure may be
caused by the fact that under the default settings SQL Server does not
allow remote connections. (provider: Named Pipes Provider, error: 40 -
Could not open a connection to SQL Server)"


Regrads,
Raju.

Uri Dimant wrote:[color=darkred
]
> raju
> Are you kidding? Do you think we have to know what is the error you are
> getting?
>
> Can you show the error's message?
>
>
>
>
> "raju" <ponnurajs@gmail.com> wrote in message
> news:1163061224.836777.35550@k70g2000cwa.googlegroups.com...

Uri Dimant

2006-11-09, 5:16 am

raju
Have you enabled remote connections (probably using TCP/IP only) in Surface
Area Configurations?

"raju" <ponnurajs@gmail.com> wrote in message
news:1163064116.082402.106640@m73g2000cwd.googlegroups.com...
> Hai,
>
> Thanks for you response.
>
> Sorry, I forget !
>
> actually my coding is
>
> sCon = "Server = ./SqlExpress;Database =KMSDB;Integrated Security =
> SSPI;"
>
> gsCon = New SqlClient.SqlConnection(sCon)
> If gsCon.State = ConnectionState.Closed Then
> gsCon.Open()
> End If
>
> sQuery = "SELECT KeyCode 'Key Code',Status
> 'Status',UserCode 'User Code',JobCode 'JobCode' " & _
> " FROM KeyHolders"
> oDaKeyHolders = New SqlClient. SqlDataAdapter(sQuer
y, gsCon)
> oDaKeyHolders.Fill(oDsKeyHolders)
>
>
> For this I am getting the error is
>
> " An error has occurred while establishing a connection to
> the server. When connecting to SQL Server 2005, this failure may be
> caused by the fact that under the default settings SQL Server does not
> allow remote connections. (provider: Named Pipes Provider, error: 40 -
> Could not open a connection to SQL Server)"
>
>
> Regrads,
> Raju.
>
> Uri Dimant wrote:
>



raju

2006-11-09, 5:16 am

Hello,

We are only installing sql express through, I don't know how to
configure that one.

pl. can you explain that one. after configure that i will try, and
update to you.

Thankyou.

Regards,
Raju.
Uri Dimant wrote:[color=darkred
]
> raju
> Have you enabled remote connections (probably using TCP/IP only) in Surface
> Area Configurations?
>
> "raju" <ponnurajs@gmail.com> wrote in message
> news:1163064116.082402.106640@m73g2000cwd.googlegroups.com...

raju

2006-11-09, 5:16 am

Hello,

I went through that surface configuration, In remote connection
and tcp/ip only.

Regrads,
Raju.

raju wrote:[color=darkred
]
> Hello,
>
> We are only installing sql express through, I don't know how to
> configure that one.
>
> pl. can you explain that one. after configure that i will try, and
> update to you.
>
> Thankyou.
>
> Regards,
> Raju.
> Uri Dimant wrote:

Uri Dimant

2006-11-09, 5:16 am

Start---Programms---Microsof SQL Server 2005---Configuration Tools---SQL
Server Surface Area Configuration

Then click on Surface Area Configuration for Services and Connections and
take a look at Remote Connections on left side



"raju" <ponnurajs@gmail.com> wrote in message
news:1163064794.124102.138220@m73g2000cwd.googlegroups.com...
> Hello,
>
> We are only installing sql express through, I don't know how to
> configure that one.
>
> pl. can you explain that one. after configure that i will try, and
> update to you.
>
> Thankyou.
>
> Regards,
> Raju.
> Uri Dimant wrote:
>



raju

2006-11-09, 5:16 am

Hello,

Yes, it is local and remote connection

TCP/IP only.

Regrads
Raju.

Uri Dimant wrote:[color=darkred
]
> Start---Programms---Microsof SQL Server 2005---Configuration Tools---SQL
> Server Surface Area Configuration
>
> Then click on Surface Area Configuration for Services and Connections and
> take a look at Remote Connections on left side
>
>
>
> "raju" <ponnurajs@gmail.com> wrote in message
> news:1163064794.124102.138220@m73g2000cwd.googlegroups.com...

raju

2006-11-09, 5:16 am

Hai,

Now i am getting the error as


"Cannot open database "KmsDb" requested by the login. The login failed.
Login failed for user 'DESIGN-EMB2\user'."

Regards,
Raju.


Uri Dimant wrote:[color=darkred
]
> Start---Programms---Microsof SQL Server 2005---Configuration Tools---SQL
> Server Surface Area Configuration
>
> Then click on Surface Area Configuration for Services and Connections and
> take a look at Remote Connections on left side
>
>
>
> "raju" <ponnurajs@gmail.com> wrote in message
> news:1163064794.124102.138220@m73g2000cwd.googlegroups.com...

Dan Guzman

2006-11-09, 7:13 pm

> "Cannot open database "KmsDb" requested by the login. The login failed.
> Login failed for user 'DESIGN-EMB2\user'."


It looks like the DESIGN-EMB2\user account has not been given database
access. You can give the login database access with:

USE KmsDb
CREATE USER [DESIGN-EMB2\user];

Depending on your application security model, you may also need to add the
user to a database role(s) in order to provide permissions.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"raju" <ponnurajs@gmail.com> wrote in message
news:1163066386.635257.153030@h48g2000cwc.googlegroups.com...
> Hai,
>
> Now i am getting the error as
>
>
> "Cannot open database "KmsDb" requested by the login. The login failed.
> Login failed for user 'DESIGN-EMB2\user'."
>
> Regards,
> Raju.
>
>
> Uri Dimant wrote:
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com