473,698 Members | 2,434 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
16 2157
Nathan,

Can you create something as this

\\\
Dim conn As New SqlClient.SqlCo nnection("Serve r=MyServerName; " & _
"DataBase=MyDat aBase; Integrated Security=SSPI")
Dim cmdTesting as new SqlClient.SQLCo mmand(txtSQLSta temement.Text,C onn)
Try
conn.open
try
cmdTesting.Exec uteNonQuery()
Catch ex as exception
response.redire ct("ex.Tostring ")
End Try
Catch ex as exception
response.Redire ct("ex.Tostring ")
Finally
conn.close
End Try
///

The reason of the error should now be showed on the page.

I hope this helps,

Cor
Nov 19 '05 #11
Yes, I used the ones you suggested.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
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 #12
I ran the following code:

Dim conn As New
SqlClient.SqlCo nnection("Serve r=MyServerName; DataBase=MyData Base;Integrated
Security=SSPI")

Dim cmdTesting As New SqlClient.SqlCo mmand(txtSQLSta tement.Text, conn)

Try

conn.Open()

Try

cmdTesting.Exec uteNonQuery()

Catch ex As Exception

Response.Write( ex.Tostring)

End Try

Catch ex As Exception

Response.Write( ex.Tostring)

Finally

conn.Close()

End Try
Which returned the following error:

System.Data.Sql Client.SqlExcep tion: SQL Server does not exist or access
denied. at System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean&
isInTransaction ) at
System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne ctionString
options, Boolean& isInTransaction ) at
System.Data.Sql Client.SqlConne ction.Open() at
PAPresenters.DB test.btnExecute _Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b:line 41

This is the same error and part of the code that I have been before (line 41
is the conn.Open() line). I am guessing, based on everything that has
happened so far, that the problem is not in my code, but somewhere in the
setup of MSDE (because ASP.NET obviously isn't detecting it). When I start
MSDE using "SQL Server Service Manager" (a tiny utility that does nothing
other than make it easier to start/pause/stop the service), the service that
I select is "SQL Server". There are also 2 other services that can be
started/stopped using this utility which are "SQL Server Agent" and
"Distribute d Transaction Coordinator". Is it possible I need to do something
with one of these also?
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:O8******** ******@tk2msftn gp13.phx.gbl...
Nathan,

Can you create something as this

\\\
Dim conn As New SqlClient.SqlCo nnection("Serve r=MyServerName; " & _
"DataBase=MyDat aBase; Integrated Security=SSPI")
Dim cmdTesting as new SqlClient.SQLCo mmand(txtSQLSta temement.Text,C onn)
Try
conn.open
try
cmdTesting.Exec uteNonQuery()
Catch ex as exception
response.redire ct("ex.Tostring ")
End Try
Catch ex as exception
response.Redire ct("ex.Tostring ")
Finally
conn.close
End Try
///

The reason of the error should now be showed on the page.

I hope this helps,

Cor

Nov 19 '05 #13
Did you try :

"Server=NJS;Tru sted_Connection =True;Database= papresenters"

?

On a box where both the web server and MSDE are running, that should connect.
Is there anything else you're doing that you haven't told us ?

Did you read
http://msdn.microsoft.com/library/de...2000webapp.asp

?

There's code samples there which I *know* work.

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:O3******** ********@TK2MSF TNGP10.phx.gbl. ..
Yes, I used the ones you suggested.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
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;Tru sted_Connection =True;Database= papresenters"

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;Tru sted_Connection =True;Database= papresenters"
>
> 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.

Nov 19 '05 #14
Nathan, try this :

Dim conn As New
SqlClient.SqlCo nnection("Serve r=NJS;Trusted_C onnection=True; Database=papres enters")

and leave the rest of the code as it is now.

re:
There are also 2 other services that can be started/stopped using this utility which are
"SQL Server Agent" and "Distribute d Transaction Coordinator". Is it possible I need to
do something with one of these also?
No. You don't need to use those.


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:%2******** ********@tk2msf tngp13.phx.gbl. ..I ran the following code:

Dim conn As New
SqlClient.SqlCo nnection("Serve r=MyServerName; DataBase=MyData Base;Integrated
Security=SSPI")

Dim cmdTesting As New SqlClient.SqlCo mmand(txtSQLSta tement.Text, conn)

Try

conn.Open()

Try

cmdTesting.Exec uteNonQuery()

Catch ex As Exception

Response.Write( ex.Tostring)

End Try

Catch ex As Exception

Response.Write( ex.Tostring)

Finally

conn.Close()

End Try
Which returned the following error:

System.Data.Sql Client.SqlExcep tion: SQL Server does not exist or access denied. at
System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean& isInTransaction ) at
System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne ctionString
options, Boolean& isInTransaction ) at System.Data.Sql Client.SqlConne ction.Open() at
PAPresenters.DB test.btnExecute _Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\PAPresenter s\DBtest.aspx.v b:line 41

This is the same error and part of the code that I have been before (line 41 is the
conn.Open() line). I am guessing, based on everything that has happened so far, that the
problem is not in my code, but somewhere in the setup of MSDE (because ASP.NET obviously
isn't detecting it). When I start MSDE using "SQL Server Service Manager" (a tiny
utility that does nothing other than make it easier to start/pause/stop the service),
the service that I select is "SQL Server". There are also 2 other services that can be
started/stopped using this utility which are "SQL Server Agent" and "Distribute d
Transaction Coordinator". Is it possible I need to do something with one of these also?
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:O8******** ******@tk2msftn gp13.phx.gbl...
Nathan,

Can you create something as this

\\\
Dim conn As New SqlClient.SqlCo nnection("Serve r=MyServerName; " & _
"DataBase=MyDat aBase; Integrated Security=SSPI")
Dim cmdTesting as new SqlClient.SQLCo mmand(txtSQLSta temement.Text,C onn)
Try
conn.open
try
cmdTesting.Exec uteNonQuery()
Catch ex as exception
response.redire ct("ex.Tostring ")
End Try
Catch ex as exception
response.Redire ct("ex.Tostring ")
Finally
conn.close
End Try
///

The reason of the error should now be showed on the page.

I hope this helps,

Cor


Nov 19 '05 #15
When using that connectionstrin g I get the following error:

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 32: cmdTesting.Comm andText = txtSQLStatement .Text
Line 33: cmdTesting.Conn ection = myconnection
Line 34: myconnection.Op en()
Line 35: cmdTesting.Exec uteNonQuery()
Line 36: myconnection.Cl ose()

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

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:34
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() +1273

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2032; ASP.NET
Version:1.1.432 2.2032
I don't know of anything I could have done that I haven't told you that
would be related in any way. If there were any more details I could give you
(and there probably are, but I'm not sure how to get them or even what they
would be) I would, but right now I'm pretty much pulling my hair out. I'm
willing to try anything. Thank you for anything you can find.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:es******** *****@TK2MSFTNG P12.phx.gbl...
Did you try :

"Server=NJS;Tru sted_Connection =True;Database= papresenters"

?

On a box where both the web server and MSDE are running, that should
connect.
Is there anything else you're doing that you haven't told us ?

Did you read
http://msdn.microsoft.com/library/de...2000webapp.asp

?

There's code samples there which I *know* work.

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:O3******** ********@TK2MSF TNGP10.phx.gbl. ..
Yes, I used the ones you suggested.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
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\ASPNE T 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;Tru sted_Connection =True;Database= papresenters"
>
> 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;Tru sted_Connection =True;Database= papresenters"
>>
>> 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
>>>>>comput er. 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.


Nov 19 '05 #16
re:
Login failed for user 'NJS\ASPNET'.

Download the SQL Web Administrator
http://www.microsoft.com/downloads/d...displaylang=en

With it, you can manage logins for MSDE databases.

Add an ad-hoc username to your PAPresenters database,
give it read/write permissions, and include that user in a new
connection string that specifies that user.

Example :

"Data Source=NJS;Init ial Catalog=PAPrese nters;User Id=YourUser;Pas sword=thePasswo rd;"

You could also add the user NJS\ASPNET to your PAPresenters database,
with the SQL Web Administrator, and use the original connection string supplied:

"Server=NJS;Tru sted_Connection =True;Database= papresenters"

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:e1******** ******@TK2MSFTN GP10.phx.gbl...
When using that connectionstrin g I get the following error:

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 32: cmdTesting.Comm andText = txtSQLStatement .Text
Line 33: cmdTesting.Conn ection = myconnection
Line 34: myconnection.Op en()
Line 35: cmdTesting.Exec uteNonQuery()
Line 36: myconnection.Cl ose()

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

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:34
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() +1273

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2032; ASP.NET
Version:1.1.432 2.2032
I don't know of anything I could have done that I haven't told you that would be related
in any way. If there were any more details I could give you (and there probably are, but
I'm not sure how to get them or even what they would be) I would, but right now I'm
pretty much pulling my hair out. I'm willing to try anything. Thank you for anything you
can find.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:es******** *****@TK2MSFTNG P12.phx.gbl...
Did you try :

"Server=NJS;Tru sted_Connection =True;Database= papresenters"

?

On a box where both the web server and MSDE are running, that should connect.
Is there anything else you're doing that you haven't told us ?

Did you read
http://msdn.microsoft.com/library/de...2000webapp.asp

?

There's code samples there which I *know* work.

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:O3******** ********@TK2MSF TNGP10.phx.gbl. ..
Yes, I used the ones you suggested.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
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;Tru sted_Connection =True;Database= papresenters"
>>
>> 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;Tru sted_Connection =True;Database= papresenters"
>>>
>>> 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.



Nov 19 '05 #17

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

Similar topics

4
2834
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 the SQL tools such the SQL Enterprise Manager and MS Query included in the professional version? ...
0
1652
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 server exployer, I get as far as successfully executing the connection test. However, when I close...
63
5905
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 would eliminate the Access version problem as well I guess.
16
1635
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 sure what it should look like. Can someone please help me determine what my connection string should...
3
1320
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
8675
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8862
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
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
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.