473,566 Members | 3,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MSDE, ASP.NET, Visual Studio .NET, and connectionstrin gs

I have Visual Studio .NET and SQL Server Desktop Engine on my computer. I
have created an empty database using Visual Studio .NET's Server Explorer.
However, I am having trouble connecting to the database using ASP.NET. I
think the problem is somewhere in my connection string, but because I do not
know much about connection strings, I am not sure what it should look like.
Can someone please help me determine what my connection string should look
like? I am using the version of IIS that comes with XP Pro. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #1
16 2143
http://www.connectionstrings.com/

--
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mi**@epprecht.n et

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP09.phx.gbl...
I have Visual Studio .NET and SQL Server Desktop Engine on my computer. I
have created an empty database using Visual Studio .NET's Server Explorer.
However, I am having trouble connecting to the database using ASP.NET. I
think the problem is somewhere in my connection string, but because I do
not
know much about connection strings, I am not sure what it should look
like.
Can someone please help me determine what my connection string should look
like? I am using the version of IIS that comes with XP Pro. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #2

1. Create at least one empty table in that database,
using the Server Explorer.

2. Use the Server Explorer's "Add Connection" wizard
( right-click "Data Connections" ) to create a connection.

3. The connection string will be created for you.

4. Right-click the created connection and select Properties.

5. Copy the connection string from the "Properties " box.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP09.phx.gbl...
I have Visual Studio .NET and SQL Server Desktop Engine on my computer. I
have created an empty database using Visual Studio .NET's Server Explorer.
However, I am having trouble connecting to the database using ASP.NET. I
think the problem is somewhere in my connection string, but because I do not
know much about connection strings, I am not sure what it should look like.
Can someone please help me determine what my connection string should look
like? I am using the version of IIS that comes with XP Pro. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #3
I have tried that, but the connectionstrin g that is created has plenty of
stuff in it that gives me errors. For example:

Server Error in '/PAPresenters' Application.
--------------------------------------------------------------------------------

Keyword not supported: 'provider'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Argument Exception: Keyword not supported:
'provider'.

Source Error:

Line 28:
Line 29: Private Sub btnExecute_Clic k(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnExecute.Clic k
Line 30: Dim myconnection As New
System.Data.Sql Client.SqlConne ction("Provider =SQLOLEDB.1;Int egrated
Security=SSPI;P ersist Security Info=False;Init ial Catalog=paprese nters;Data
Source=NJS;Use Procedure for Prepare=1;Auto Translate=True; Packet
Size=4096;Works tation ID=NJS;Use Encryption for Data=False;Tag with column
collation when possible=False" )
Line 31: Dim cmdTesting As New System.Data.Sql Client.SqlComma nd
Line 32: Dim dataadapter As New System.Data.Sql Client.SqlDataA dapter

Source File: c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b Line: 30

Stack Trace:

[ArgumentExcepti on: Keyword not supported: 'provider'.]
System.Data.Com mon.DBConnectio nString.ParseIn ternal(Char[]
connectionStrin g, UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Com mon.DBConnectio nString..ctor(S tring connectionStrin g,
UdlSupport checkForUdl) +114
System.Data.Sql Client.SqlConne ctionString..ct or(String connectionStrin g)
+13
System.Data.Sql Client.SqlConne ctionString.Par seString(String
connectionStrin g) +96
System.Data.Sql Client.SqlConne ction.set_Conne ctionString(Str ing value)
+11
System.Data.Sql Client.SqlConne ction..ctor(Str ing connectionStrin g) +158
PAPresenters.DB test.btnExecute _Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b:30
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2032; ASP.NET
Version:1.1.432 2.2032

Although I don't know much about connectionstrin gs, the little bit of
experience I have leads me to think that the connectionstrin g generated by
Visual Studio .NET has a lot more stuff in it than necessary, but either way
it is not working. Why is this, and how can I fix it? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:e8******** ********@TK2MSF TNGP12.phx.gbl. ..

1. Create at least one empty table in that database,
using the Server Explorer.

2. Use the Server Explorer's "Add Connection" wizard
( right-click "Data Connections" ) to create a connection.

3. The connection string will be created for you.

4. Right-click the created connection and select Properties.

5. Copy the connection string from the "Properties " box.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP09.phx.gbl...
I have Visual Studio .NET and SQL Server Desktop Engine on my computer. I
have created an empty database using Visual Studio .NET's Server
Explorer.
However, I am having trouble connecting to the database using ASP.NET. I
think the problem is somewhere in my connection string, but because I do
not
know much about connection strings, I am not sure what it should look
like.
Can someone please help me determine what my connection string should
look
like? I am using the version of IIS that comes with XP Pro. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/


Nov 19 '05 #4
It looks like you selected the wrong provider when creating the connection.

You should select the ".NET Framework Data Provider for SQL Server"
for a provider.

Try it using that provider. You should get a correct string if you do.

If you still have problems, try a simpler connection string :

"Server=NJS;Int egrated Security=True;D atabase=paprese nters"

That assumes that your MSDE's instance name is "NJS"
and that your database name is "papresente rs".


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:es******** ******@TK2MSFTN GP09.phx.gbl...
I have tried that, but the connectionstrin g that is created has plenty of stuff in it
that gives me errors. For example:

Server Error in '/PAPresenters' Application.
--------------------------------------------------------------------------------

Keyword not supported: 'provider'.
Description: An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and where it
originated in the code.

Exception Details: System.Argument Exception: Keyword not supported: 'provider'.

Source Error:

Line 28:
Line 29: Private Sub btnExecute_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnExecute.Clic k
Line 30: Dim myconnection As New
System.Data.Sql Client.SqlConne ction("Provider =SQLOLEDB.1;Int egrated
Security=SSPI;P ersist Security Info=False;Init ial Catalog=paprese nters;Data
Source=NJS;Use Procedure for Prepare=1;Auto Translate=True; Packet Size=4096;Works tation
ID=NJS;Use Encryption for Data=False;Tag with column collation when possible=False" )
Line 31: Dim cmdTesting As New System.Data.Sql Client.SqlComma nd
Line 32: Dim dataadapter As New System.Data.Sql Client.SqlDataA dapter

Source File: c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b Line: 30

Stack Trace:

[ArgumentExcepti on: Keyword not supported: 'provider'.]
System.Data.Com mon.DBConnectio nString.ParseIn ternal(Char[] connectionStrin g,
UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Com mon.DBConnectio nString..ctor(S tring connectionStrin g, UdlSupport
checkForUdl) +114
System.Data.Sql Client.SqlConne ctionString..ct or(String connectionStrin g) +13
System.Data.Sql Client.SqlConne ctionString.Par seString(String connectionStrin g) +96
System.Data.Sql Client.SqlConne ction.set_Conne ctionString(Str ing value) +11
System.Data.Sql Client.SqlConne ction..ctor(Str ing connectionStrin g) +158
PAPresenters.DB test.btnExecute _Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b:30
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String
eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2032; ASP.NET
Version:1.1.432 2.2032

Although I don't know much about connectionstrin gs, the little bit of experience I have
leads me to think that the connectionstrin g generated by Visual Studio .NET has a lot
more stuff in it than necessary, but either way it is not working. Why is this, and how
can I fix it? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:e8******** ********@TK2MSF TNGP12.phx.gbl. ..

1. Create at least one empty table in that database,
using the Server Explorer.

2. Use the Server Explorer's "Add Connection" wizard
( right-click "Data Connections" ) to create a connection.

3. The connection string will be created for you.

4. Right-click the created connection and select Properties.

5. Copy the connection string from the "Properties " box.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP09.phx.gbl...
I have Visual Studio .NET and SQL Server Desktop Engine on my computer. I
have created an empty database using Visual Studio .NET's Server Explorer.
However, I am having trouble connecting to the database using ASP.NET. I
think the problem is somewhere in my connection string, but because I do not
know much about connection strings, I am not sure what it should look like.
Can someone please help me determine what my connection string should look
like? I am using the version of IIS that comes with XP Pro. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/



Nov 19 '05 #5
Hello Nathan,

Try the following connection string

"Driver={SQ L Server};Server= 127.0.0.1;Datab ase=<database>; Uid=sa;Pwd=;"en ter
the name of the database, the user and the password in the appropriate
places.This info will most likely go in your web.config. The following is a
great site forconnection strings http://www.connectionstrings.com/-- IIS
Guruhttp://www.iisassistan ce.com
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP09.phx.gbl...
I have Visual Studio .NET and SQL Server Desktop Engine on my computer. I
have created an empty database using Visual Studio .NET's Server Explorer.
However, I am having trouble connecting to the database using ASP.NET. I
think the problem is somewhere in my connection string, but because I do
not
know much about connection strings, I am not sure what it should look
like.
Can someone please help me determine what my connection string should look
like? I am using the version of IIS that comes with XP Pro. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #6
I think I am now passed the problem of the connectionstrin g, but am
recieving a login failed error, as follows:

Server Error in '/PAPresenters' Application.
--------------------------------------------------------------------------------

Login failed for user 'NJS\ASPNET'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for user
'NJS\ASPNET'.

Source Error:

Line 33: cmdTesting.Comm andText = txtSQLStatement .Text
Line 34: cmdTesting.Conn ection = myconnection
Line 35: myconnection.Op en()
Line 36: cmdTesting.Exec uteNonQuery()
Line 37: myconnection.Cl ose()

Source File: c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b Line: 35

Stack Trace:

[SqlException: Login failed for user 'NJS\ASPNET'.]
System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean&
isInTransaction ) +474
System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne ctionString
options, Boolean& isInTransaction ) +372
System.Data.Sql Client.SqlConne ction.Open() +384
PAPresenters.DB test.btnExecute _Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b:35
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2032; ASP.NET
Version:1.1.432 2.2032
I create my connection as follows:
Dim myconnection As New System.Data.Sql Client.SqlConne ction("Data
Source=NJS;Init ial Catalog=paprese nters;Integrate d Security=SSPI;" )

I did not create a username or password when I created the database. I know
what the user ASPNET is, so do I just need to include that somewhere in the
connectionstrin g? If I do, do I need to include a password along with it? If
so, what would this password be (my windows password?)? Thanks again.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Mike Epprecht (SQL MVP)" <mi**@epprecht. net> wrote in message
news:uG******** ******@TK2MSFTN GP10.phx.gbl...
http://www.connectionstrings.com/

--
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mi**@epprecht.n et

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP09.phx.gbl...
I have Visual Studio .NET and SQL Server Desktop Engine on my computer. I
have created an empty database using Visual Studio .NET's Server
Explorer.
However, I am having trouble connecting to the database using ASP.NET. I
think the problem is somewhere in my connection string, but because I do
not
know much about connection strings, I am not sure what it should look
like.
Can someone please help me determine what my connection string should
look
like? I am using the version of IIS that comes with XP Pro. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/


Nov 19 '05 #7
I think I tried it under .NET Beta 2, instead of .NET 1.1.
Nevertheless, try the simpler connection string I suggested.

Per
http://msdn.microsoft.com/library/de...2000webapp.asp
a slightly more optimized connection string is :

"Server=localho st;Database=Pic s2Share;Trusted _Connection=Tru e;
Connection Timeout=60;Pool ing=True;Min Pool Size=1;Max Pool Size=5"

But the simpler connection string I suggested
should give you basic connectivity :

"Server=NJS;Int egrated Security=True;D atabase=paprese nters"

The optimized connection string for your case would be :

"Server=NJS;Dat abase=papresent ers;Trusted_Con nection=True;
Connection Timeout=60;Pool ing=True;Min Pool Size=1;Max Pool Size=5"

You could also use
"Server=(local) ;Database=papre senters;Trusted _Connection=Tru e;
Connection Timeout=60;Pool ing=True;Min Pool Size=1;Max Pool Size=5"

Using Trusted_Connect ion should prevent the error you're getting:
Login failed for user 'NJS\ASPNET'.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Oi******** ******@TK2MSFTN GP14.phx.gbl...
That is not one of the listed providers. the listed providers that are brought up are:

If there is somewhere on the web that I can download the provider you mentioned from, I
would like to know about it, but right now all I have are the ones shown above. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:ex******** ******@TK2MSFTN GP12.phx.gbl...
It looks like you selected the wrong provider when creating the connection.

You should select the ".NET Framework Data Provider for SQL Server"
for a provider.

Try it using that provider. You should get a correct string if you do.

If you still have problems, try a simpler connection string :

"Server=NJS;Int egrated Security=True;D atabase=paprese nters"

That assumes that your MSDE's instance name is "NJS"
and that your database name is "papresente rs".


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:es******** ******@TK2MSFTN GP09.phx.gbl...
I have tried that, but the connectionstrin g that is created has plenty of stuff in it
that gives me errors. For example:

Server Error in '/PAPresenters' Application.
--------------------------------------------------------------------------------

Keyword not supported: 'provider'.
Description: An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and where
it
originated in the code.

Exception Details: System.Argument Exception: Keyword not supported: 'provider'.

Source Error:

Line 28:
Line 29: Private Sub btnExecute_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnExecute.Clic k
Line 30: Dim myconnection As New
System.Data.Sql Client.SqlConne ction("Provider =SQLOLEDB.1;Int egrated
Security=SSPI;P ersist Security Info=False;Init ial Catalog=paprese nters;Data
Source=NJS;Use Procedure for Prepare=1;Auto Translate=True; Packet Size=4096;Works tation
ID=NJS;Use Encryption for Data=False;Tag with column collation when possible=False" )
Line 31: Dim cmdTesting As New System.Data.Sql Client.SqlComma nd
Line 32: Dim dataadapter As New System.Data.Sql Client.SqlDataA dapter

Source File: c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b Line: 30

Stack Trace:

[ArgumentExcepti on: Keyword not supported: 'provider'.]
System.Data.Com mon.DBConnectio nString.ParseIn ternal(Char[] connectionStrin g,
UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Com mon.DBConnectio nString..ctor(S tring connectionStrin g, UdlSupport
checkForUdl) +114
System.Data.Sql Client.SqlConne ctionString..ct or(String connectionStrin g) +13
System.Data.Sql Client.SqlConne ctionString.Par seString(String connectionStrin g) +96
System.Data.Sql Client.SqlConne ction.set_Conne ctionString(Str ing value) +11
System.Data.Sql Client.SqlConne ction..ctor(Str ing connectionStrin g) +158
PAPresenters.DB test.btnExecute _Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b:30
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String
eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2032; ASP.NET
Version:1.1.432 2.2032

Although I don't know much about connectionstrin gs, the little bit of experience I have
leads me to think that the connectionstrin g generated by Visual Studio .NET has a lot
more stuff in it than necessary, but either way it is not working. Why is this, and how
can I fix it? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:e8******** ********@TK2MSF TNGP12.phx.gbl. ..

1. Create at least one empty table in that database,
using the Server Explorer.

2. Use the Server Explorer's "Add Connection" wizard
( right-click "Data Connections" ) to create a connection.

3. The connection string will be created for you.

4. Right-click the created connection and select Properties.

5. Copy the connection string from the "Properties " box.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP09.phx.gbl...
I have Visual Studio .NET and SQL Server Desktop Engine on my computer. I
have created an empty database using Visual Studio .NET's Server Explorer.
However, I am having trouble connecting to the database using ASP.NET. I
think the problem is somewhere in my connection string, but because I do not
know much about connection strings, I am not sure what it should look like.
Can someone please help me determine what my connection string should look
like? I am using the version of IIS that comes with XP Pro. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/




Nov 19 '05 #8
I eventually got past the Login Failed error by adding permissions for
NJS\ASPNET to the database file. However, I am now recieving the following
error:
Server Error in '/PAPresenters' Application.
--------------------------------------------------------------------------------

SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.Sql Client.SqlExcep tion: SQL Server does not
exist or access denied.

Source Error:

Line 33: cmdTesting.Comm andText = txtSQLStatement .Text
Line 34: cmdTesting.Conn ection = myconnection
Line 35: myconnection.Op en()
Line 36: cmdTesting.Exec uteNonQuery()
Line 37: myconnection.Cl ose()

Source File: c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b Line: 35

Stack Trace:

[SqlException: SQL Server does not exist or access denied.]
System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean&
isInTransaction ) +474
System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne ctionString
options, Boolean& isInTransaction ) +372
System.Data.Sql Client.SqlConne ction.Open() +384
PAPresenters.DB test.btnExecute _Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b:35
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2032; ASP.NET
Version:1.1.432 2.2032
I have SQL Server Desktop Engine running (when I hover my cursor over the
icon in the system tray it says "Running - \\NJS - MSSQLSERVER" and the icon
shows the green arrow, which means it is running). What am I not doing?
Thank you very much for your help, I greatly appreciate the quick responses.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I think I tried it under .NET Beta 2, instead of .NET 1.1.
Nevertheless, try the simpler connection string I suggested.

Per
http://msdn.microsoft.com/library/de...2000webapp.asp
a slightly more optimized connection string is :

"Server=localho st;Database=Pic s2Share;Trusted _Connection=Tru e;
Connection Timeout=60;Pool ing=True;Min Pool Size=1;Max Pool Size=5"

But the simpler connection string I suggested
should give you basic connectivity :

"Server=NJS;Int egrated Security=True;D atabase=paprese nters"

The optimized connection string for your case would be :

"Server=NJS;Dat abase=papresent ers;Trusted_Con nection=True;
Connection Timeout=60;Pool ing=True;Min Pool Size=1;Max Pool Size=5"

You could also use
"Server=(local) ;Database=papre senters;Trusted _Connection=Tru e;
Connection Timeout=60;Pool ing=True;Min Pool Size=1;Max Pool Size=5"

Using Trusted_Connect ion should prevent the error you're getting:
Login failed for user 'NJS\ASPNET'.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Oi******** ******@TK2MSFTN GP14.phx.gbl...
That is not one of the listed providers. the listed providers that are
brought up are:

If there is somewhere on the web that I can download the provider you
mentioned from, I would like to know about it, but right now all I have
are the ones shown above. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:ex******** ******@TK2MSFTN GP12.phx.gbl...
It looks like you selected the wrong provider when creating the
connection.

You should select the ".NET Framework Data Provider for SQL Server"
for a provider.

Try it using that provider. You should get a correct string if you do.

If you still have problems, try a simpler connection string :

"Server=NJS;Int egrated Security=True;D atabase=paprese nters"

That assumes that your MSDE's instance name is "NJS"
and that your database name is "papresente rs".


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:es******** ******@TK2MSFTN GP09.phx.gbl...
I have tried that, but the connectionstrin g that is created has plenty of
stuff in it
that gives me errors. For example:

Server Error in '/PAPresenters' Application.
--------------------------------------------------------------------------------

Keyword not supported: 'provider'.
Description: An unhandled exception occurred during the execution of the
current web
request. Please review the stack trace for more information about the
error and where it
originated in the code.

Exception Details: System.Argument Exception: Keyword not supported:
'provider'.

Source Error:

Line 28:
Line 29: Private Sub btnExecute_Clic k(ByVal sender As System.Object,
ByVal e As
System.EventArg s) Handles btnExecute.Clic k
Line 30: Dim myconnection As New
System.Data.Sql Client.SqlConne ction("Provider =SQLOLEDB.1;Int egrated
Security=SSPI;P ersist Security Info=False;Init ial
Catalog=paprese nters;Data
Source=NJS;Use Procedure for Prepare=1;Auto Translate=True; Packet
Size=4096;Works tation
ID=NJS;Use Encryption for Data=False;Tag with column collation when
possible=False" )
Line 31: Dim cmdTesting As New System.Data.Sql Client.SqlComma nd
Line 32: Dim dataadapter As New
System.Data.Sql Client.SqlDataA dapter

Source File: c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b Line: 30

Stack Trace:

[ArgumentExcepti on: Keyword not supported: 'provider'.]
System.Data.Com mon.DBConnectio nString.ParseIn ternal(Char[]
connectionStrin g,
UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Com mon.DBConnectio nString..ctor(S tring connectionStrin g,
UdlSupport
checkForUdl) +114
System.Data.Sql Client.SqlConne ctionString..ct or(String
connectionStrin g) +13
System.Data.Sql Client.SqlConne ctionString.Par seString(String
connectionStrin g) +96
System.Data.Sql Client.SqlConne ction.set_Conne ctionString(Str ing value)
+11
System.Data.Sql Client.SqlConne ction..ctor(Str ing connectionStrin g)
+158
PAPresenters.DB test.btnExecute _Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b:30
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String
eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
+33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2032;
ASP.NET
Version:1.1.432 2.2032

Although I don't know much about connectionstrin gs, the little bit of
experience I have
leads me to think that the connectionstrin g generated by Visual Studio
.NET has a lot
more stuff in it than necessary, but either way it is not working. Why
is this, and how
can I fix it? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:e8******** ********@TK2MSF TNGP12.phx.gbl. ..

1. Create at least one empty table in that database,
using the Server Explorer.

2. Use the Server Explorer's "Add Connection" wizard
( right-click "Data Connections" ) to create a connection.

3. The connection string will be created for you.

4. Right-click the created connection and select Properties.

5. Copy the connection string from the "Properties " box.


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:e7******** ******@TK2MSFTN GP09.phx.gbl...
>I have Visual Studio .NET and SQL Server Desktop Engine on my computer.
>I
> have created an empty database using Visual Studio .NET's Server
> Explorer.
> However, I am having trouble connecting to the database using ASP.NET.
> I
> think the problem is somewhere in my connection string, but because I
> do not
> know much about connection strings, I am not sure what it should look
> like.
> Can someone please help me determine what my connection string should
> look
> like? I am using the version of IIS that comes with XP Pro. Thanks.
> --
> Nathan Sokalski
> nj********@hotm ail.com
> http://www.nathansokalski.com/
>
>
>



Nov 19 '05 #9
Did you try the connection strings I suggested,
or are you still using the other connection strings ?

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:es******** ******@tk2msftn gp13.phx.gbl...
I eventually got past the Login Failed error by adding permissions for NJS\ASPNET to the
database file. However, I am now recieving the following error:
Server Error in '/PAPresenters' Application.
--------------------------------------------------------------------------------

SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and where it
originated in the code.

Exception Details: System.Data.Sql Client.SqlExcep tion: SQL Server does not exist or
access denied.

Source Error:

Line 33: cmdTesting.Comm andText = txtSQLStatement .Text
Line 34: cmdTesting.Conn ection = myconnection
Line 35: myconnection.Op en()
Line 36: cmdTesting.Exec uteNonQuery()
Line 37: myconnection.Cl ose()

Source File: c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b Line: 35

Stack Trace:

[SqlException: SQL Server does not exist or access denied.]
System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean& isInTransaction ) +474
System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne ctionString
options, Boolean& isInTransaction ) +372
System.Data.Sql Client.SqlConne ction.Open() +384
PAPresenters.DB test.btnExecute _Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b:35
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String
eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2032; ASP.NET
Version:1.1.432 2.2032
I have SQL Server Desktop Engine running (when I hover my cursor over the icon in the
system tray it says "Running - \\NJS - MSSQLSERVER" and the icon shows the green arrow,
which means it is running). What am I not doing? Thank you very much for your help, I
greatly appreciate the quick responses.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I think I tried it under .NET Beta 2, instead of .NET 1.1.
Nevertheless, try the simpler connection string I suggested.

Per
http://msdn.microsoft.com/library/de...2000webapp.asp
a slightly more optimized connection string is :

"Server=localho st;Database=Pic s2Share;Trusted _Connection=Tru e;
Connection Timeout=60;Pool ing=True;Min Pool Size=1;Max Pool Size=5"

But the simpler connection string I suggested
should give you basic connectivity :

"Server=NJS;Int egrated Security=True;D atabase=paprese nters"

The optimized connection string for your case would be :

"Server=NJS;Dat abase=papresent ers;Trusted_Con nection=True;
Connection Timeout=60;Pool ing=True;Min Pool Size=1;Max Pool Size=5"

You could also use
"Server=(local) ;Database=papre senters;Trusted _Connection=Tru e;
Connection Timeout=60;Pool ing=True;Min Pool Size=1;Max Pool Size=5"

Using Trusted_Connect ion should prevent the error you're getting:
Login failed for user 'NJS\ASPNET'.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:Oi******** ******@TK2MSFTN GP14.phx.gbl...
That is not one of the listed providers. the listed providers that are brought up are:

If there is somewhere on the web that I can download the provider you mentioned from, I
would like to know about it, but right now all I have are the ones shown above. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:ex******** ******@TK2MSFTN GP12.phx.gbl...
It looks like you selected the wrong provider when creating the connection.

You should select the ".NET Framework Data Provider for SQL Server"
for a provider.

Try it using that provider. You should get a correct string if you do.

If you still have problems, try a simpler connection string :

"Server=NJS;Int egrated Security=True;D atabase=paprese nters"

That assumes that your MSDE's instance name is "NJS"
and that your database name is "papresente rs".


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:es******** ******@TK2MSFTN GP09.phx.gbl...
I have tried that, but the connectionstrin g that is created has plenty of stuff in it
that gives me errors. For example:

Server Error in '/PAPresenters' Application.
--------------------------------------------------------------------------------

Keyword not supported: 'provider'.
Description: An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and where
it
originated in the code.

Exception Details: System.Argument Exception: Keyword not supported: 'provider'.

Source Error:

Line 28:
Line 29: Private Sub btnExecute_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnExecute.Clic k
Line 30: Dim myconnection As New
System.Data.Sql Client.SqlConne ction("Provider =SQLOLEDB.1;Int egrated
Security=SSPI;P ersist Security Info=False;Init ial Catalog=paprese nters;Data
Source=NJS;Use Procedure for Prepare=1;Auto Translate=True; Packet
Size=4096;Works tation
ID=NJS;Use Encryption for Data=False;Tag with column collation when possible=False" )
Line 31: Dim cmdTesting As New System.Data.Sql Client.SqlComma nd
Line 32: Dim dataadapter As New System.Data.Sql Client.SqlDataA dapter

Source File: c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b Line: 30

Stack Trace:

[ArgumentExcepti on: Keyword not supported: 'provider'.]
System.Data.Com mon.DBConnectio nString.ParseIn ternal(Char[] connectionStrin g,
UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Com mon.DBConnectio nString..ctor(S tring connectionStrin g, UdlSupport
checkForUdl) +114
System.Data.Sql Client.SqlConne ctionString..ct or(String connectionStrin g) +13
System.Data.Sql Client.SqlConne ctionString.Par seString(String connectionStrin g) +96
System.Data.Sql Client.SqlConne ction.set_Conne ctionString(Str ing value) +11
System.Data.Sql Client.SqlConne ction..ctor(Str ing connectionStrin g) +158
PAPresenters.DB test.btnExecute _Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b:30
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String
eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2032; ASP.NET
Version:1.1.432 2.2032

Although I don't know much about connectionstrin gs, the little bit of experience I
have
leads me to think that the connectionstrin g generated by Visual Studio .NET has a lot
more stuff in it than necessary, but either way it is not working. Why is this, and
how
can I fix it? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:e8******** ********@TK2MSF TNGP12.phx.gbl. ..
>
> 1. Create at least one empty table in that database,
> using the Server Explorer.
>
> 2. Use the Server Explorer's "Add Connection" wizard
> ( right-click "Data Connections" ) to create a connection.
>
> 3. The connection string will be created for you.
>
> 4. Right-click the created connection and select Properties.
>
> 5. Copy the connection string from the "Properties " box.
>
>
>
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Español
> Ven, y hablemos de ASP.NET...
> =============== =======
>
> "Nathan Sokalski" <nj********@hot mail.com> wrote in message
> news:e7******** ******@TK2MSFTN GP09.phx.gbl...
>>I have Visual Studio .NET and SQL Server Desktop Engine on my computer. I
>> have created an empty database using Visual Studio .NET's Server Explorer.
>> However, I am having trouble connecting to the database using ASP.NET. I
>> think the problem is somewhere in my connection string, but because I do not
>> know much about connection strings, I am not sure what it should look like.
>> Can someone please help me determine what my connection string should look
>> like? I am using the version of IIS that comes with XP Pro. Thanks.
>> --
>> Nathan Sokalski
>> nj********@hotm ail.com
>> http://www.nathansokalski.com/
>>
>>
>>
>
>



Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2828
by: Paul S | last post by:
I have a copy of MS Visual Studio 2002 Professional ACADEMIC which I understand is the same as the regular Professional version with the addition of a student CDROM. The installation program on the first CDROM only copies the MSDE to the harddrive and the copied setup file has to then be manually executed to complete the installation. Are...
0
1644
by: bob .net | last post by:
Server exploI have recently installed Visual Studio .Net 2002 on my workstation running XP Professional. I can connect to local Access and MSDE databases successfully using ADO .Net. I can also setup ODBC dsn's that I can use from Access to browse my MSDE databases. When I try to add a new MSDE data connection from within Visual Studio's...
63
5842
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy in Visual Studio to create reports and labels as it's in Access?` The advantage of VS.net is that not every user needs Access, right? And that...
16
1629
by: Nathan Sokalski | last post by:
I have Visual Studio .NET and SQL Server Desktop Engine on my computer. I have created an empty database using Visual Studio .NET's Server Explorer. However, I am having trouble connecting to the database using ASP.NET. I think the problem is somewhere in my connection string, but because I do not know much about connection strings, I am not...
3
1311
by: Charles A. Lackman | last post by:
Hello, I have MSDE Installed on a different computer (WIndows 2003) within my network. I also have MSDE Installed on my production computer for development. I have successfully created databases on both computers using OSQL. What I would really like to accomplish is a connection from the Server Explorer in Visual Studio .NET.
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.