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********@hotmail.com http://www.nathansokalski.com/ 16 1926 http://www.connectionstrings.com/
--
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mi**@epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:e7**************@TK2MSFTNGP09.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********@hotmail.com http://www.nathansokalski.com/
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********@hotmail.com> wrote in message
news:e7**************@TK2MSFTNGP09.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********@hotmail.com http://www.nathansokalski.com/
I have tried that, but the connectionstring 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.ArgumentException: Keyword not supported:
'provider'.
Source Error:
Line 28:
Line 29: Private Sub btnExecute_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnExecute.Click
Line 30: Dim myconnection As New
System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=papresenters;Data
Source=NJS;Use Procedure for Prepare=1;Auto Translate=True;Packet
Size=4096;Workstation ID=NJS;Use Encryption for Data=False;Tag with column
collation when possible=False")
Line 31: Dim cmdTesting As New System.Data.SqlClient.SqlCommand
Line 32: Dim dataadapter As New System.Data.SqlClient.SqlDataAdapter
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 30
Stack Trace:
[ArgumentException: Keyword not supported: 'provider'.]
System.Data.Common.DBConnectionString.ParseInterna l(Char[]
connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Common.DBConnectionString..ctor(String connectionString,
UdlSupport checkForUdl) +114
System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString)
+13
System.Data.SqlClient.SqlConnectionString.ParseStr ing(String
connectionString) +96
System.Data.SqlClient.SqlConnection.set_Connection String(String value)
+11
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158
PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:30
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
Although I don't know much about connectionstrings, the little bit of
experience I have leads me to think that the connectionstring 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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:e8****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message news:e7**************@TK2MSFTNGP09.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********@hotmail.com http://www.nathansokalski.com/
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;Integrated Security=True;Database=papresenters"
That assumes that your MSDE's instance name is "NJS"
and that your database name is "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********@hotmail.com> wrote in message
news:es**************@TK2MSFTNGP09.phx.gbl... I have tried that, but the connectionstring 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.ArgumentException: Keyword not supported: 'provider'.
Source Error:
Line 28: Line 29: Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click Line 30: Dim myconnection As New System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=papresenters;Data Source=NJS;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=NJS;Use Encryption for Data=False;Tag with column collation when possible=False") Line 31: Dim cmdTesting As New System.Data.SqlClient.SqlCommand Line 32: Dim dataadapter As New System.Data.SqlClient.SqlDataAdapter
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 30
Stack Trace:
[ArgumentException: Keyword not supported: 'provider'.] System.Data.Common.DBConnectionString.ParseInterna l(Char[] connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1133 System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) +114 System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString) +13 System.Data.SqlClient.SqlConnectionString.ParseStr ing(String connectionString) +96 System.Data.SqlClient.SqlConnection.set_Connection String(String value) +11 System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158 PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:30 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032 Although I don't know much about connectionstrings, the little bit of experience I have leads me to think that the connectionstring 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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:e8****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message news:e7**************@TK2MSFTNGP09.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********@hotmail.com http://www.nathansokalski.com/
Hello Nathan,
Try the following connection string
"Driver={SQL Server};Server=127.0.0.1;Database=<database>;Uid=s a;Pwd=;"enter
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.iisassistance.com
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:e7**************@TK2MSFTNGP09.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********@hotmail.com http://www.nathansokalski.com/
I think I am now passed the problem of the connectionstring, 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.SqlClient.SqlException: Login failed for user
'NJS\ASPNET'.
Source Error:
Line 33: cmdTesting.CommandText = txtSQLStatement.Text
Line 34: cmdTesting.Connection = myconnection
Line 35: myconnection.Open()
Line 36: cmdTesting.ExecuteNonQuery()
Line 37: myconnection.Close()
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 35
Stack Trace:
[SqlException: Login failed for user 'NJS\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:35
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
I create my connection as follows:
Dim myconnection As New System.Data.SqlClient.SqlConnection("Data
Source=NJS;Initial Catalog=papresenters;Integrated 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
connectionstring? 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********@hotmail.com http://www.nathansokalski.com/
"Mike Epprecht (SQL MVP)" <mi**@epprecht.net> wrote in message
news:uG**************@TK2MSFTNGP10.phx.gbl... http://www.connectionstrings.com/
-- -------------------------------- Mike Epprecht, Microsoft SQL Server MVP Zurich, Switzerland
IM: mi**@epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Nathan Sokalski" <nj********@hotmail.com> wrote in message news:e7**************@TK2MSFTNGP09.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********@hotmail.com http://www.nathansokalski.com/
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=localhost;Database=Pics2Share;Trusted_Conn ection=True;
Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
But the simpler connection string I suggested
should give you basic connectivity :
"Server=NJS;Integrated Security=True;Database=papresenters"
The optimized connection string for your case would be :
"Server=NJS;Database=papresenters;Trusted_Connecti on=True;
Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
You could also use
"Server=(local);Database=papresenters;Trusted_Conn ection=True;
Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
Using Trusted_Connection 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********@hotmail.com> wrote in message
news:Oi**************@TK2MSFTNGP14.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:ex**************@TK2MSFTNGP12.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;Integrated Security=True;Database=papresenters"
That assumes that your MSDE's instance name is "NJS" and that your database name is "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********@hotmail.com> wrote in message news:es**************@TK2MSFTNGP09.phx.gbl...I have tried that, but the connectionstring 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.ArgumentException: Keyword not supported: 'provider'.
Source Error:
Line 28: Line 29: Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click Line 30: Dim myconnection As New System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=papresenters;Data Source=NJS;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=NJS;Use Encryption for Data=False;Tag with column collation when possible=False") Line 31: Dim cmdTesting As New System.Data.SqlClient.SqlCommand Line 32: Dim dataadapter As New System.Data.SqlClient.SqlDataAdapter
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 30
Stack Trace:
[ArgumentException: Keyword not supported: 'provider'.] System.Data.Common.DBConnectionString.ParseInterna l(Char[] connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1133 System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) +114 System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString) +13 System.Data.SqlClient.SqlConnectionString.ParseStr ing(String connectionString) +96 System.Data.SqlClient.SqlConnection.set_Connection String(String value) +11 System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158 PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:30 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032 Although I don't know much about connectionstrings, the little bit of experience I have leads me to think that the connectionstring 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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:e8****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message news:e7**************@TK2MSFTNGP09.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********@hotmail.com http://www.nathansokalski.com/
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.SqlClient.SqlException: SQL Server does not
exist or access denied.
Source Error:
Line 33: cmdTesting.CommandText = txtSQLStatement.Text
Line 34: cmdTesting.Connection = myconnection
Line 35: myconnection.Open()
Line 36: cmdTesting.ExecuteNonQuery()
Line 37: myconnection.Close()
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 35
Stack Trace:
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:35
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP15.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=localhost;Database=Pics2Share;Trusted_Conn ection=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
But the simpler connection string I suggested should give you basic connectivity :
"Server=NJS;Integrated Security=True;Database=papresenters"
The optimized connection string for your case would be :
"Server=NJS;Database=papresenters;Trusted_Connecti on=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
You could also use "Server=(local);Database=papresenters;Trusted_Conn ection=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
Using Trusted_Connection 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********@hotmail.com> wrote in message news:Oi**************@TK2MSFTNGP14.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:ex**************@TK2MSFTNGP12.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;Integrated Security=True;Database=papresenters"
That assumes that your MSDE's instance name is "NJS" and that your database name is "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********@hotmail.com> wrote in message news:es**************@TK2MSFTNGP09.phx.gbl...I have tried that, but the connectionstring 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.ArgumentException: Keyword not supported: 'provider'.
Source Error:
Line 28: Line 29: Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click Line 30: Dim myconnection As New System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=papresenters;Data Source=NJS;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=NJS;Use Encryption for Data=False;Tag with column collation when possible=False") Line 31: Dim cmdTesting As New System.Data.SqlClient.SqlCommand Line 32: Dim dataadapter As New System.Data.SqlClient.SqlDataAdapter
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 30
Stack Trace:
[ArgumentException: Keyword not supported: 'provider'.] System.Data.Common.DBConnectionString.ParseInterna l(Char[] connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1133 System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) +114 System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString) +13 System.Data.SqlClient.SqlConnectionString.ParseStr ing(String connectionString) +96 System.Data.SqlClient.SqlConnection.set_Connection String(String value) +11 System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158 PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:30 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032 Although I don't know much about connectionstrings, the little bit of experience I have leads me to think that the connectionstring 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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:e8****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message news:e7**************@TK2MSFTNGP09.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********@hotmail.com > http://www.nathansokalski.com/ > > >
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********@hotmail.com> wrote in message
news:es**************@tk2msftngp13.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.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
Line 33: cmdTesting.CommandText = txtSQLStatement.Text Line 34: cmdTesting.Connection = myconnection Line 35: myconnection.Open() Line 36: cmdTesting.ExecuteNonQuery() Line 37: myconnection.Close()
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 35
Stack Trace:
[SqlException: SQL Server does not exist or access denied.] System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +474 System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:35 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@TK2MSFTNGP15.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=localhost;Database=Pics2Share;Trusted_Conn ection=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
But the simpler connection string I suggested should give you basic connectivity :
"Server=NJS;Integrated Security=True;Database=papresenters"
The optimized connection string for your case would be :
"Server=NJS;Database=papresenters;Trusted_Connecti on=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
You could also use "Server=(local);Database=papresenters;Trusted_Conn ection=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
Using Trusted_Connection 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********@hotmail.com> wrote in message news:Oi**************@TK2MSFTNGP14.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:ex**************@TK2MSFTNGP12.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;Integrated Security=True;Database=papresenters"
That assumes that your MSDE's instance name is "NJS" and that your database name is "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********@hotmail.com> wrote in message news:es**************@TK2MSFTNGP09.phx.gbl... I have tried that, but the connectionstring 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.ArgumentException: Keyword not supported: 'provider'.
Source Error:
Line 28: Line 29: Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click Line 30: Dim myconnection As New System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=papresenters;Data Source=NJS;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=NJS;Use Encryption for Data=False;Tag with column collation when possible=False") Line 31: Dim cmdTesting As New System.Data.SqlClient.SqlCommand Line 32: Dim dataadapter As New System.Data.SqlClient.SqlDataAdapter
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 30
Stack Trace:
[ArgumentException: Keyword not supported: 'provider'.] System.Data.Common.DBConnectionString.ParseInterna l(Char[] connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1133 System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) +114 System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString) +13 System.Data.SqlClient.SqlConnectionString.ParseStr ing(String connectionString) +96 System.Data.SqlClient.SqlConnection.set_Connection String(String value) +11 System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158 PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:30 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032 Although I don't know much about connectionstrings, the little bit of experience I have leads me to think that the connectionstring 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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:e8****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message > news:e7**************@TK2MSFTNGP09.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********@hotmail.com >> http://www.nathansokalski.com/ >> >> >> > >
Nathan,
Can you create something as this
\\\
Dim conn As New SqlClient.SqlConnection("Server=MyServerName;" & _
"DataBase=MyDataBase; Integrated Security=SSPI")
Dim cmdTesting as new SqlClient.SQLCommand(txtSQLStatemement.Text,Conn)
Try
conn.open
try
cmdTesting.ExecuteNonQuery()
Catch ex as exception
response.redirect("ex.Tostring")
End Try
Catch ex as exception
response.Redirect("ex.Tostring")
Finally
conn.close
End Try
///
The reason of the error should now be showed on the page.
I hope this helps,
Cor
Yes, I used the ones you suggested.
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@tk2msftngp13.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********@hotmail.com> wrote in message news:es**************@tk2msftngp13.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.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
Line 33: cmdTesting.CommandText = txtSQLStatement.Text Line 34: cmdTesting.Connection = myconnection Line 35: myconnection.Open() Line 36: cmdTesting.ExecuteNonQuery() Line 37: myconnection.Close()
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 35
Stack Trace:
[SqlException: SQL Server does not exist or access denied.] System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:35 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@TK2MSFTNGP15.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=localhost;Database=Pics2Share;Trusted_Conn ection=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
But the simpler connection string I suggested should give you basic connectivity :
"Server=NJS;Integrated Security=True;Database=papresenters"
The optimized connection string for your case would be :
"Server=NJS;Database=papresenters;Trusted_Connecti on=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
You could also use "Server=(local);Database=papresenters;Trusted_Conn ection=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
Using Trusted_Connection 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********@hotmail.com> wrote in message news:Oi**************@TK2MSFTNGP14.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:ex**************@TK2MSFTNGP12.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;Integrated Security=True;Database=papresenters"
That assumes that your MSDE's instance name is "NJS" and that your database name is "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********@hotmail.com> wrote in message news:es**************@TK2MSFTNGP09.phx.gbl... >I have tried that, but the connectionstring 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.ArgumentException: Keyword not supported: > 'provider'. > > Source Error: > > Line 28: > Line 29: Private Sub btnExecute_Click(ByVal sender As > System.Object, ByVal e As > System.EventArgs) Handles btnExecute.Click > Line 30: Dim myconnection As New > System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated > Security=SSPI;Persist Security Info=False;Initial > Catalog=papresenters;Data > Source=NJS;Use Procedure for Prepare=1;Auto Translate=True;Packet > Size=4096;Workstation > ID=NJS;Use Encryption for Data=False;Tag with column collation when > possible=False") > Line 31: Dim cmdTesting As New > System.Data.SqlClient.SqlCommand > Line 32: Dim dataadapter As New > System.Data.SqlClient.SqlDataAdapter > > Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: > 30 > > Stack Trace: > > [ArgumentException: Keyword not supported: 'provider'.] > System.Data.Common.DBConnectionString.ParseInterna l(Char[] > connectionString, > UdlSupport checkForUdl, NameValuePair& keychain) +1133 > System.Data.Common.DBConnectionString..ctor(String connectionString, > UdlSupport > checkForUdl) +114 > System.Data.SqlClient.SqlConnectionString..ctor(St ring > connectionString) +13 > System.Data.SqlClient.SqlConnectionString.ParseStr ing(String > connectionString) +96 > System.Data.SqlClient.SqlConnection.set_Connection String(String > value) +11 > System.Data.SqlClient.SqlConnection..ctor(String connectionString) > +158 > PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in > c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:30 > System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 > > System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String > eventArgument) +57 > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler > sourceControl, String > eventArgument) +18 > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) > +33 > System.Web.UI.Page.ProcessRequestMain() +1292 > > > > -------------------------------------------------------------------------------- > Version Information: Microsoft .NET Framework Version:1.1.4322.2032; > ASP.NET > Version:1.1.4322.2032 > > > > Although I don't know much about connectionstrings, the little bit of > experience I have > leads me to think that the connectionstring 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********@hotmail.com > http://www.nathansokalski.com/ > > "Juan T. Llibre" <no***********@nowhere.com> wrote in message > news:e8****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message >> news:e7**************@TK2MSFTNGP09.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********@hotmail.com >>> http://www.nathansokalski.com/ >>> >>> >>> >> >> > >
I ran the following code:
Dim conn As New
SqlClient.SqlConnection("Server=MyServerName;DataB ase=MyDataBase;Integrated
Security=SSPI")
Dim cmdTesting As New SqlClient.SqlCommand(txtSQLStatement.Text, conn)
Try
conn.Open()
Try
cmdTesting.ExecuteNonQuery()
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.SqlClient.SqlException: SQL Server does not exist or access
denied. at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction) at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction) at
System.Data.SqlClient.SqlConnection.Open() at
PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:lin e 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
"Distributed Transaction Coordinator". Is it possible I need to do something
with one of these also?
--
Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Cor Ligthert" <no************@planet.nl> wrote in message
news:O8**************@tk2msftngp13.phx.gbl... Nathan,
Can you create something as this
\\\ Dim conn As New SqlClient.SqlConnection("Server=MyServerName;" & _ "DataBase=MyDataBase; Integrated Security=SSPI") Dim cmdTesting as new SqlClient.SQLCommand(txtSQLStatemement.Text,Conn) Try conn.open try cmdTesting.ExecuteNonQuery() Catch ex as exception response.redirect("ex.Tostring") End Try Catch ex as exception response.Redirect("ex.Tostring") Finally conn.close End Try ///
The reason of the error should now be showed on the page.
I hope this helps,
Cor
Did you try :
"Server=NJS;Trusted_Connection=True;Database=papre senters"
?
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********@hotmail.com> wrote in message
news:O3****************@TK2MSFTNGP10.phx.gbl... Yes, I used the ones you suggested. -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@tk2msftngp13.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********@hotmail.com> wrote in message news:es**************@tk2msftngp13.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.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
Line 33: cmdTesting.CommandText = txtSQLStatement.Text Line 34: cmdTesting.Connection = myconnection Line 35: myconnection.Open() Line 36: cmdTesting.ExecuteNonQuery() Line 37: myconnection.Close()
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 35
Stack Trace:
[SqlException: SQL Server does not exist or access denied.] System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:35 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@TK2MSFTNGP15.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=localhost;Database=Pics2Share;Trusted_Conn ection=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
But the simpler connection string I suggested should give you basic connectivity :
"Server=NJS;Trusted_Connection=True;Database=papre senters"
The optimized connection string for your case would be :
"Server=NJS;Database=papresenters;Trusted_Connecti on=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
You could also use "Server=(local);Database=papresenters;Trusted_Conn ection=True; Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5"
Using Trusted_Connection 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********@hotmail.com> wrote in message news:Oi**************@TK2MSFTNGP14.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:ex**************@TK2MSFTNGP12.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;Trusted_Connection=True;Database=papre senters" > > That assumes that your MSDE's instance name is "NJS" > and that your database name is "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********@hotmail.com> wrote in message > news:es**************@TK2MSFTNGP09.phx.gbl... >>I have tried that, but the connectionstring 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.ArgumentException: Keyword not supported: 'provider'. >> >> Source Error: >> >> Line 28: >> Line 29: Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As >> System.EventArgs) Handles btnExecute.Click >> Line 30: Dim myconnection As New >> System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated >> Security=SSPI;Persist Security Info=False;Initial Catalog=papresenters;Data >> Source=NJS;Use Procedure for Prepare=1;Auto Translate=True;Packet >> Size=4096;Workstation >> ID=NJS;Use Encryption for Data=False;Tag with column collation when >> possible=False") >> Line 31: Dim cmdTesting As New System.Data.SqlClient.SqlCommand >> Line 32: Dim dataadapter As New System.Data.SqlClient.SqlDataAdapter >> >> Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 30 >> >> Stack Trace: >> >> [ArgumentException: Keyword not supported: 'provider'.] >> System.Data.Common.DBConnectionString.ParseInterna l(Char[] connectionString, >> UdlSupport checkForUdl, NameValuePair& keychain) +1133 >> System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport >> checkForUdl) +114 >> System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString) +13 >> System.Data.SqlClient.SqlConnectionString.ParseStr ing(String connectionString) >> +96 >> System.Data.SqlClient.SqlConnection.set_Connection String(String value) +11 >> System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158 >> PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in >> c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:30 >> System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 >> >> System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String >> eventArgument) +57 >> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String >> eventArgument) +18 >> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 >> System.Web.UI.Page.ProcessRequestMain() +1292 >> >> >> >> -------------------------------------------------------------------------------- >> Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET >> Version:1.1.4322.2032 >> >> >> >> Although I don't know much about connectionstrings, the little bit of experience I >> have >> leads me to think that the connectionstring 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********@hotmail.com >> http://www.nathansokalski.com/ >> >> "Juan T. Llibre" <no***********@nowhere.com> wrote in message >> news:e8****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message >>> news:e7**************@TK2MSFTNGP09.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, try this :
Dim conn As New
SqlClient.SqlConnection("Server=NJS;Trusted_Connec tion=True;Database=papresenters")
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 "Distributed 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********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...I ran the following code:
Dim conn As New SqlClient.SqlConnection("Server=MyServerName;DataB ase=MyDataBase;Integrated Security=SSPI")
Dim cmdTesting As New SqlClient.SqlCommand(txtSQLStatement.Text, conn)
Try
conn.Open()
Try
cmdTesting.ExecuteNonQuery()
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.SqlClient.SqlException: SQL Server does not exist or access denied. at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:lin e 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 "Distributed Transaction Coordinator". Is it possible I need to do something with one of these also? -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/ "Cor Ligthert" <no************@planet.nl> wrote in message news:O8**************@tk2msftngp13.phx.gbl... Nathan,
Can you create something as this
\\\ Dim conn As New SqlClient.SqlConnection("Server=MyServerName;" & _ "DataBase=MyDataBase; Integrated Security=SSPI") Dim cmdTesting as new SqlClient.SQLCommand(txtSQLStatemement.Text,Conn) Try conn.open try cmdTesting.ExecuteNonQuery() Catch ex as exception response.redirect("ex.Tostring") End Try Catch ex as exception response.Redirect("ex.Tostring") Finally conn.close End Try ///
The reason of the error should now be showed on the page.
I hope this helps,
Cor
When using that connectionstring 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.SqlClient.SqlException: Login failed for user
'NJS\ASPNET'.
Source Error:
Line 32: cmdTesting.CommandText = txtSQLStatement.Text
Line 33: cmdTesting.Connection = myconnection
Line 34: myconnection.Open()
Line 35: cmdTesting.ExecuteNonQuery()
Line 36: myconnection.Close()
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 34
Stack Trace:
[SqlException: Login failed for user 'NJS\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:34
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1273
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:es*************@TK2MSFTNGP12.phx.gbl... Did you try :
"Server=NJS;Trusted_Connection=True;Database=papre senters"
?
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********@hotmail.com> wrote in message news:O3****************@TK2MSFTNGP10.phx.gbl... Yes, I used the ones you suggested. -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@tk2msftngp13.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********@hotmail.com> wrote in message news:es**************@tk2msftngp13.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.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
Line 33: cmdTesting.CommandText = txtSQLStatement.Text Line 34: cmdTesting.Connection = myconnection Line 35: myconnection.Open() Line 36: cmdTesting.ExecuteNonQuery() Line 37: myconnection.Close()
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 35
Stack Trace:
[SqlException: SQL Server does not exist or access denied.] System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:35 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@TK2MSFTNGP15.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=localhost;Database=Pics2Share;Trusted_Conn ection=True; > Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5" > > But the simpler connection string I suggested > should give you basic connectivity : > > "Server=NJS;Trusted_Connection=True;Database=papre senters" > > The optimized connection string for your case would be : > > "Server=NJS;Database=papresenters;Trusted_Connecti on=True; > Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5" > > You could also use > "Server=(local);Database=papresenters;Trusted_Conn ection=True; > Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5" > > Using Trusted_Connection 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********@hotmail.com> wrote in message > news:Oi**************@TK2MSFTNGP14.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********@hotmail.com > http://www.nathansokalski.com/ > > "Juan T. Llibre" <no***********@nowhere.com> wrote in message > news:ex**************@TK2MSFTNGP12.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;Trusted_Connection=True;Database=papre senters" >> >> That assumes that your MSDE's instance name is "NJS" >> and that your database name is "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********@hotmail.com> wrote in message >> news:es**************@TK2MSFTNGP09.phx.gbl... >>>I have tried that, but the connectionstring 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.ArgumentException: Keyword not supported: >>> 'provider'. >>> >>> Source Error: >>> >>> Line 28: >>> Line 29: Private Sub btnExecute_Click(ByVal sender As >>> System.Object, ByVal e As >>> System.EventArgs) Handles btnExecute.Click >>> Line 30: Dim myconnection As New >>> System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated >>> Security=SSPI;Persist Security Info=False;Initial >>> Catalog=papresenters;Data >>> Source=NJS;Use Procedure for Prepare=1;Auto Translate=True;Packet >>> Size=4096;Workstation >>> ID=NJS;Use Encryption for Data=False;Tag with column collation when >>> possible=False") >>> Line 31: Dim cmdTesting As New >>> System.Data.SqlClient.SqlCommand >>> Line 32: Dim dataadapter As New >>> System.Data.SqlClient.SqlDataAdapter >>> >>> Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: >>> 30 >>> >>> Stack Trace: >>> >>> [ArgumentException: Keyword not supported: 'provider'.] >>> System.Data.Common.DBConnectionString.ParseInterna l(Char[] >>> connectionString, >>> UdlSupport checkForUdl, NameValuePair& keychain) +1133 >>> System.Data.Common.DBConnectionString..ctor(String >>> connectionString, UdlSupport >>> checkForUdl) +114 >>> System.Data.SqlClient.SqlConnectionString..ctor(St ring >>> connectionString) +13 >>> System.Data.SqlClient.SqlConnectionString.ParseStr ing(String >>> connectionString) +96 >>> System.Data.SqlClient.SqlConnection.set_Connection String(String >>> value) +11 >>> System.Data.SqlClient.SqlConnection..ctor(String connectionString) >>> +158 >>> PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) >>> in >>> c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:30 >>> System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 >>> >>> System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String >>> eventArgument) +57 >>> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler >>> sourceControl, String >>> eventArgument) +18 >>> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection >>> postData) +33 >>> System.Web.UI.Page.ProcessRequestMain() +1292 >>> >>> >>> >>> -------------------------------------------------------------------------------- >>> Version Information: Microsoft .NET Framework Version:1.1.4322.2032; >>> ASP.NET >>> Version:1.1.4322.2032 >>> >>> >>> >>> Although I don't know much about connectionstrings, the little bit >>> of experience I have >>> leads me to think that the connectionstring 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********@hotmail.com >>> http://www.nathansokalski.com/ >>> >>> "Juan T. Llibre" <no***********@nowhere.com> wrote in message >>> news:e8****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message >>>> news:e7**************@TK2MSFTNGP09.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.
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;Initial Catalog=PAPresenters;User Id=YourUser;Password=thePassword;"
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;Trusted_Connection=True;Database=papre senters"
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********@hotmail.com> wrote in message
news:e1**************@TK2MSFTNGP10.phx.gbl... When using that connectionstring 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.SqlClient.SqlException: Login failed for user 'NJS\ASPNET'.
Source Error:
Line 32: cmdTesting.CommandText = txtSQLStatement.Text Line 33: cmdTesting.Connection = myconnection Line 34: myconnection.Open() Line 35: cmdTesting.ExecuteNonQuery() Line 36: myconnection.Close()
Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 34
Stack Trace:
[SqlException: Login failed for user 'NJS\ASPNET'.] System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +474 System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:34 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1273 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.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********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:es*************@TK2MSFTNGP12.phx.gbl... Did you try :
"Server=NJS;Trusted_Connection=True;Database=papre senters"
?
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********@hotmail.com> wrote in message news:O3****************@TK2MSFTNGP10.phx.gbl... Yes, I used the ones you suggested. -- Nathan Sokalski nj********@hotmail.com http://www.nathansokalski.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message news:%2****************@tk2msftngp13.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********@hotmail.com> wrote in message news:es**************@tk2msftngp13.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.SqlClient.SqlException: SQL Server does not exist or > access denied. > > Source Error: > > Line 33: cmdTesting.CommandText = txtSQLStatement.Text > Line 34: cmdTesting.Connection = myconnection > Line 35: myconnection.Open() > Line 36: cmdTesting.ExecuteNonQuery() > Line 37: myconnection.Close() > > Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 35 > > Stack Trace: > > [SqlException: SQL Server does not exist or access denied.] > System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +474 > > System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString > options, Boolean& isInTransaction) +372 > System.Data.SqlClient.SqlConnection.Open() +384 > PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in > c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:35 > System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 > > System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String > eventArgument) +57 > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String > eventArgument) +18 > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 > System.Web.UI.Page.ProcessRequestMain() +1292 > > > > -------------------------------------------------------------------------------- > Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET > Version:1.1.4322.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********@hotmail.com > http://www.nathansokalski.com/ > > "Juan T. Llibre" <no***********@nowhere.com> wrote in message > news:%2****************@TK2MSFTNGP15.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=localhost;Database=Pics2Share;Trusted_Conn ection=True; >> Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5" >> >> But the simpler connection string I suggested >> should give you basic connectivity : >> >> "Server=NJS;Trusted_Connection=True;Database=papre senters" >> >> The optimized connection string for your case would be : >> >> "Server=NJS;Database=papresenters;Trusted_Connecti on=True; >> Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5" >> >> You could also use >> "Server=(local);Database=papresenters;Trusted_Conn ection=True; >> Connection Timeout=60;Pooling=True;Min Pool Size=1;Max Pool Size=5" >> >> Using Trusted_Connection 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********@hotmail.com> wrote in message >> news:Oi**************@TK2MSFTNGP14.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********@hotmail.com >> http://www.nathansokalski.com/ >> >> "Juan T. Llibre" <no***********@nowhere.com> wrote in message >> news:ex**************@TK2MSFTNGP12.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;Trusted_Connection=True;Database=papre senters" >>> >>> That assumes that your MSDE's instance name is "NJS" >>> and that your database name is "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********@hotmail.com> wrote in message >>> news:es**************@TK2MSFTNGP09.phx.gbl... >>>>I have tried that, but the connectionstring 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.ArgumentException: Keyword not supported: 'provider'. >>>> >>>> Source Error: >>>> >>>> Line 28: >>>> Line 29: Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e >>>> As >>>> System.EventArgs) Handles btnExecute.Click >>>> Line 30: Dim myconnection As New >>>> System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated >>>> Security=SSPI;Persist Security Info=False;Initial Catalog=papresenters;Data >>>> Source=NJS;Use Procedure for Prepare=1;Auto Translate=True;Packet >>>> Size=4096;Workstation >>>> ID=NJS;Use Encryption for Data=False;Tag with column collation when >>>> possible=False") >>>> Line 31: Dim cmdTesting As New System.Data.SqlClient.SqlCommand >>>> Line 32: Dim dataadapter As New System.Data.SqlClient.SqlDataAdapter >>>> >>>> Source File: c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb Line: 30 >>>> >>>> Stack Trace: >>>> >>>> [ArgumentException: Keyword not supported: 'provider'.] >>>> System.Data.Common.DBConnectionString.ParseInterna l(Char[] connectionString, >>>> UdlSupport checkForUdl, NameValuePair& keychain) +1133 >>>> System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport >>>> checkForUdl) +114 >>>> System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString) +13 >>>> System.Data.SqlClient.SqlConnectionString.ParseStr ing(String connectionString) >>>> +96 >>>> System.Data.SqlClient.SqlConnection.set_Connection String(String value) +11 >>>> System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158 >>>> PAPresenters.DBtest.btnExecute_Click(Object sender, EventArgs e) in >>>> c:\inetpub\wwwroot\PAPresenters\DBtest.aspx.vb:30 >>>> System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 >>>> >>>> System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String >>>> eventArgument) +57 >>>> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, >>>> String >>>> eventArgument) +18 >>>> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 >>>> System.Web.UI.Page.ProcessRequestMain() +1292 >>>> >>>> >>>> >>>> -------------------------------------------------------------------------------- >>>> Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET >>>> Version:1.1.4322.2032 >>>> >>>> >>>> >>>> Although I don't know much about connectionstrings, the little bit of experience >>>> I have >>>> leads me to think that the connectionstring 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********@hotmail.com >>>> http://www.nathansokalski.com/ >>>> >>>> "Juan T. Llibre" <no***********@nowhere.com> wrote in message >>>> news:e8****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message >>>>> news:e7**************@TK2MSFTNGP09.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.
This discussion thread is closed Replies have been disabled for this discussion. Similar topics
4 posts
views
Thread by Paul S |
last post: by
|
reply
views
Thread by bob .net |
last post: by
|
63 posts
views
Thread by Jerome |
last post: by
|
16 posts
views
Thread by Nathan Sokalski |
last post: by
|
3 posts
views
Thread by Charles A. Lackman |
last post: by
| | | | | | | | | | | |