Showing posts with label explain. Show all posts
Showing posts with label explain. Show all posts

Wednesday, March 28, 2012

Login failed for user ''. The user is not associated with a trusted SQL Server connection. &qu

Hi all,

Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?

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 ''. The user is not associated with a trusted SQL Server connection.

Here is my code and i am using windows authentication:

<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>

<%

Dim connAkaki As SqlConnection
Dim cmdSelectAuthers As SqlCommand
Dim dtrAuthers As SqlDataReader

connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki")

connAkaki.Open()

cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
dtrAuthers= cmdSelectAuthers.ExecuteReader()

While dtrAuthers.Read()
Response.Write("<li>")
Response.Write(dtrAuthers("Firstname"))

End While

dtrAuthers.Close()
connAkaki.Close()

%>

Have you added the ASP.Net service account as a user in SQL Server? The error message is saying that the current user that is trying to connect has not been registered as a login in SQL Server.|||Hi there,

I was going to reply to your earlier post on the same/similar topic but since this one's newer I will post here.

The username with which the ASP.NET web application runs is different to the username you used to log into the computer with so chances are that the user is not defined in SQL Server's list of logins and so you get problems when using Windows Authentication.

A way around this is to use SQL Server authentication when trying to access your SQL Server. If you do this, your connection string will be:

connAkai = new System.Data.SqlClient.SqlConnection("Server=.\\NATHAN;database=Northwind; User ID=<SQL Server Login>; Password=<Password For Login>");

In a production system you would probably do more to secure that password (i.e. don't place it plain-text in the code) like putting it in the registry or some other methods but as an example I think it will do.

Hope that helps a bit, but sorry if it doesn't

|||

The SQL Server system by default is set to use only Windows Accounts and not SQL Server authentication, you can turn it on but I would leave it as is and use the windows accounts.

With ASP.Net generally the asp.net system by default runs under the Network Service account, to use it in the database you will need to make sure that the Network Service account has permissions for the database that you are using.

Another option is to make the asp.net application that you are working use a different account, this will help to secure your application. One way to do this is to reconfigure the application pool for the asp.net application that you have and make it run under the new account.

|||

Hi All!

How can add the ASP.Net service account as a user in SQL Server 2005?

|||

Huh? An MS Knowledge base article (http://support.microsoft.com/kb/555332) says just the opposite:

RESOLUTION

Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".

|||

Steps to change SQLExpress to "SQL Server and Windows Authentication Mode"

If you are lucky to have Microsoft SQL server Management Studio installed, then can browse to the SQL server Instance and right-click to bring up the Server Property. Server Property -> Security -> check "SQL Server and Windows Authentication Mode" option under "Server Authentication" section, and then restart the SQLExpress.

If you don't have Microsoft SQL server Management Studio installed, the if you are running on XP Professional, following SQL statements will do the same:

You have to first login to SQLExpress using osql utility.

USE [master]

GO

EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2

GO

Hope that will help.

Derek

|||

Hey Glen, I have the same problem only I can't get sqlexpress to allow me to logon in SQL Server Auth mode. I can't even logon using my server (in my house). It will let me log on in Windows Authentication but not SQL Server Authentication? I have nothing on this machine and I reininstalled SQL Express twice. I am the sole admin .

All I want to do is create a blank database (which I did) and log onto it. I watched video 7 on microsoft and opened my fireall udp and added me as doadmin. I added sqlbrowser.exe,sqlserver.exe and udp port 1434 for sql via web in windows firewall. I also opened port 1434 on my hardlinksys router which only has port 80 and 1434 udp opened. (Public Webserver not hacked yet). Eventually, I added all permissions for my self (admin). I right clicked on my new database ("WebWizforums") IE not real database name. I added permissions under my user name and granted all permissions.It's only my user name in permissions noone else. I'll tighten ship perms after I see that she works...

Forum software is what I want to try http://www.webwizguide.com/webwizforums/kb/sql_server_install.asp seems real easy but I can't figure it out? MS Access I knew inside and out but now ...no more MSDE or MSJet on Longhorn OS.

Can anyone explain this simple task "Clearly?" Pretend I have no idea what I'm doing .... Smile Thanks Gates for forcing my higher "edgeamycashun."

SQL Express for dummies!

Learning SQL is like filing tax returns...put it off to the last minute!

Mike C

|||

Ok, I triple checked everything then I rebooted....now it works? I guess start and stop will be learned as stupid sql tricks.

ok, I added the database tables with no problems however, I get this message when I log into the (ADMIN.asp) page

Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.

Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp

Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute

I searched for Common.asp and right clicked it. It has READ at min. So next is connection String?

I got yarn? but no connection.

Getting closer Watson.

Mike

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Hi all,

Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?

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 ''. The user is not associated with a trusted SQL Server connection.

Here is my code and i am using windows authentication:

<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>

<%

Dim connAkaki As SqlConnection
Dim cmdSelectAuthers As SqlCommand
Dim dtrAuthers As SqlDataReader

connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki")

connAkaki.Open()

cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
dtrAuthers= cmdSelectAuthers.ExecuteReader()

While dtrAuthers.Read()
Response.Write("<li>")
Response.Write(dtrAuthers("Firstname"))

End While

dtrAuthers.Close()
connAkaki.Close()

%>

Have you added the ASP.Net service account as a user in SQL Server? The error message is saying that the current user that is trying to connect has not been registered as a login in SQL Server.|||Hi there,

I was going to reply to your earlier post on the same/similar topic but since this one's newer I will post here.

The username with which the ASP.NET web application runs is different to the username you used to log into the computer with so chances are that the user is not defined in SQL Server's list of logins and so you get problems when using Windows Authentication.

A way around this is to use SQL Server authentication when trying to access your SQL Server. If you do this, your connection string will be:

connAkai = new System.Data.SqlClient.SqlConnection("Server=.\\NATHAN;database=Northwind; User ID=<SQL Server Login>; Password=<Password For Login>");

In a production system you would probably do more to secure that password (i.e. don't place it plain-text in the code) like putting it in the registry or some other methods but as an example I think it will do.

Hope that helps a bit, but sorry if it doesn't

|||

The SQL Server system by default is set to use only Windows Accounts and not SQL Server authentication, you can turn it on but I would leave it as is and use the windows accounts.

With ASP.Net generally the asp.net system by default runs under the Network Service account, to use it in the database you will need to make sure that the Network Service account has permissions for the database that you are using.

Another option is to make the asp.net application that you are working use a different account, this will help to secure your application. One way to do this is to reconfigure the application pool for the asp.net application that you have and make it run under the new account.

|||

Hi All!

How can add the ASP.Net service account as a user in SQL Server 2005?

|||

Huh? An MS Knowledge base article (http://support.microsoft.com/kb/555332) says just the opposite:

RESOLUTION

Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".

|||

Steps to change SQLExpress to "SQL Server and Windows Authentication Mode"

If you are lucky to have Microsoft SQL server Management Studio installed, then can browse to the SQL server Instance and right-click to bring up the Server Property. Server Property -> Security -> check "SQL Server and Windows Authentication Mode" option under "Server Authentication" section, and then restart the SQLExpress.

If you don't have Microsoft SQL server Management Studio installed, the if you are running on XP Professional, following SQL statements will do the same:

You have to first login to SQLExpress using osql utility.

USE [master]

GO

EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2

GO

Hope that will help.

Derek

|||

Hey Glen, I have the same problem only I can't get sqlexpress to allow me to logon in SQL Server Auth mode. I can't even logon using my server (in my house). It will let me log on in Windows Authentication but not SQL Server Authentication? I have nothing on this machine and I reininstalled SQL Express twice. I am the sole admin .

All I want to do is create a blank database (which I did) and log onto it. I watched video 7 on microsoft and opened my fireall udp and added me as doadmin. I added sqlbrowser.exe,sqlserver.exe and udp port 1434 for sql via web in windows firewall. I also opened port 1434 on my hardlinksys router which only has port 80 and 1434 udp opened. (Public Webserver not hacked yet). Eventually, I added all permissions for my self (admin). I right clicked on my new database ("WebWizforums") IE not real database name. I added permissions under my user name and granted all permissions.It's only my user name in permissions noone else. I'll tighten ship perms after I see that she works...

Forum software is what I want to try http://www.webwizguide.com/webwizforums/kb/sql_server_install.asp seems real easy but I can't figure it out? MS Access I knew inside and out but now ...no more MSDE or MSJet on Longhorn OS.

Can anyone explain this simple task "Clearly?" Pretend I have no idea what I'm doing .... Smile Thanks Gates for forcing my higher "edgeamycashun."

SQL Express for dummies!

Learning SQL is like filing tax returns...put it off to the last minute!

Mike C

|||

Ok, I triple checked everything then I rebooted....now it works? I guess start and stop will be learned as stupid sql tricks.

ok, I added the database tables with no problems however, I get this message when I log into the (ADMIN.asp) page

Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.

Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp

Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute

I searched for Common.asp and right clicked it. It has READ at min. So next is connection String?

I got yarn? but no connection.

Getting closer Watson.

Mike

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Hi all,

Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?

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 ''. The user is not associated with a trusted SQL Server connection.

Here is my code and i am using windows authentication:

<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>

<%

Dim connAkaki As SqlConnection
Dim cmdSelectAuthers As SqlCommand
Dim dtrAuthers As SqlDataReader

connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki")


connAkaki.Open()

cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
dtrAuthers= cmdSelectAuthers.ExecuteReader()


While dtrAuthers.Read()
Response.Write("<li>")
Response.Write(dtrAuthers("Firstname"))

End While

dtrAuthers.Close()
connAkaki.Close()

%>

Have you added the ASP.Net service account as a user in SQL Server? The error message is saying that the current user that is trying to connect has not been registered as a login in SQL Server.|||Hi there,

I was going to reply to your earlier post on the same/similar topic but since this one's newer I will post here.

The username with which the ASP.NET web application runs is different to the username you used to log into the computer with so chances are that the user is not defined in SQL Server's list of logins and so you get problems when using Windows Authentication.

A way around this is to use SQL Server authentication when trying to access your SQL Server. If you do this, your connection string will be:

connAkai = new System.Data.SqlClient.SqlConnection("Server=.\\NATHAN;database=Northwind; User ID=<SQL Server Login>; Password=<Password For Login>");

In a production system you would probably do more to secure that password (i.e. don't place it plain-text in the code) like putting it in the registry or some other methods but as an example I think it will do.

Hope that helps a bit, but sorry if it doesn't

|||

The SQL Server system by default is set to use only Windows Accounts and not SQL Server authentication, you can turn it on but I would leave it as is and use the windows accounts.

With ASP.Net generally the asp.net system by default runs under the Network Service account, to use it in the database you will need to make sure that the Network Service account has permissions for the database that you are using.

Another option is to make the asp.net application that you are working use a different account, this will help to secure your application. One way to do this is to reconfigure the application pool for the asp.net application that you have and make it run under the new account.

|||

Hi All!

How can add the ASP.Net service account as a user in SQL Server 2005?

|||

Huh? An MS Knowledge base article (http://support.microsoft.com/kb/555332) says just the opposite:

RESOLUTION

Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".

|||

Steps to change SQLExpress to "SQL Server and Windows Authentication Mode"

If you are lucky to have Microsoft SQL server Management Studio installed, then can browse to the SQL server Instance and right-click to bring up the Server Property. Server Property -> Security -> check "SQL Server and Windows Authentication Mode" option under "Server Authentication" section, and then restart the SQLExpress.

If you don't have Microsoft SQL server Management Studio installed, the if you are running on XP Professional, following SQL statements will do the same:

You have to first login to SQLExpress using osql utility.

USE [master]

GO

EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2

GO

Hope that will help.

Derek

|||

Hey Glen, I have the same problem only I can't get sqlexpress to allow me to logon in SQL Server Auth mode. I can't even logon using my server (in my house). It will let me log on in Windows Authentication but not SQL Server Authentication? I have nothing on this machine and I reininstalled SQL Express twice. I am the sole admin .

All I want to do is create a blank database (which I did) and log onto it. I watched video 7 on microsoft and opened my fireall udp and added me as doadmin. I added sqlbrowser.exe,sqlserver.exe and udp port 1434 for sql via web in windows firewall. I also opened port 1434 on my hardlinksys router which only has port 80 and 1434 udp opened. (Public Webserver not hacked yet). Eventually, I added all permissions for my self (admin). I right clicked on my new database ("WebWizforums") IE not real database name. I added permissions under my user name and granted all permissions.It's only my user name in permissions noone else. I'll tighten ship perms after I see that she works...

Forum software is what I want to try http://www.webwizguide.com/webwizforums/kb/sql_server_install.asp seems real easy but I can't figure it out? MS Access I knew inside and out but now ...no more MSDE or MSJet on Longhorn OS.

Can anyone explain this simple task "Clearly?" Pretend I have no idea what I'm doing .... Smile Thanks Gates for forcing my higher "edgeamycashun."

SQL Express for dummies!

Learning SQL is like filing tax returns...put it off to the last minute!

Mike C

|||

Ok, I triple checked everything then I rebooted....now it works? I guess start and stop will be learned as stupid sql tricks.

ok, I added the database tables with no problems however, I get this message when I log into the (ADMIN.asp) page

Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.

Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp

Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute

I searched for Common.asp and right clicked it. It has READ at min. So next is connection String?

I got yarn? but no connection.

Getting closer Watson.

Mike

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Hi all,

Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?

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 ''. The user is not associated with a trusted SQL Server connection.

Here is my code and i am using windows authentication:

<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>

<%

Dim connAkaki As SqlConnection
Dim cmdSelectAuthers As SqlCommand
Dim dtrAuthers As SqlDataReader

connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki")

connAkaki.Open()

cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
dtrAuthers= cmdSelectAuthers.ExecuteReader()

While dtrAuthers.Read()
Response.Write("<li>")
Response.Write(dtrAuthers("Firstname"))

End While

dtrAuthers.Close()
connAkaki.Close()

%>

Have you added the ASP.Net service account as a user in SQL Server? The error message is saying that the current user that is trying to connect has not been registered as a login in SQL Server.|||Hi there,

I was going to reply to your earlier post on the same/similar topic but since this one's newer I will post here.

The username with which the ASP.NET web application runs is different to the username you used to log into the computer with so chances are that the user is not defined in SQL Server's list of logins and so you get problems when using Windows Authentication.

A way around this is to use SQL Server authentication when trying to access your SQL Server. If you do this, your connection string will be:

connAkai = new System.Data.SqlClient.SqlConnection("Server=.\\NATHAN;database=Northwind; User ID=<SQL Server Login>; Password=<Password For Login>");

In a production system you would probably do more to secure that password (i.e. don't place it plain-text in the code) like putting it in the registry or some other methods but as an example I think it will do.

Hope that helps a bit, but sorry if it doesn't

|||

The SQL Server system by default is set to use only Windows Accounts and not SQL Server authentication, you can turn it on but I would leave it as is and use the windows accounts.

With ASP.Net generally the asp.net system by default runs under the Network Service account, to use it in the database you will need to make sure that the Network Service account has permissions for the database that you are using.

Another option is to make the asp.net application that you are working use a different account, this will help to secure your application. One way to do this is to reconfigure the application pool for the asp.net application that you have and make it run under the new account.

|||

Hi All!

How can add the ASP.Net service account as a user in SQL Server 2005?

|||

Huh? An MS Knowledge base article (http://support.microsoft.com/kb/555332) says just the opposite:

RESOLUTION

Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".

|||

Steps to change SQLExpress to "SQL Server and Windows Authentication Mode"

If you are lucky to have Microsoft SQL server Management Studio installed, then can browse to the SQL server Instance and right-click to bring up the Server Property. Server Property -> Security -> check "SQL Server and Windows Authentication Mode" option under "Server Authentication" section, and then restart the SQLExpress.

If you don't have Microsoft SQL server Management Studio installed, the if you are running on XP Professional, following SQL statements will do the same:

You have to first login to SQLExpress using osql utility.

USE [master]

GO

EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2

GO

Hope that will help.

Derek

|||

Hey Glen, I have the same problem only I can't get sqlexpress to allow me to logon in SQL Server Auth mode. I can't even logon using my server (in my house). It will let me log on in Windows Authentication but not SQL Server Authentication? I have nothing on this machine and I reininstalled SQL Express twice. I am the sole admin .

All I want to do is create a blank database (which I did) and log onto it. I watched video 7 on microsoft and opened my fireall udp and added me as doadmin. I added sqlbrowser.exe,sqlserver.exe and udp port 1434 for sql via web in windows firewall. I also opened port 1434 on my hardlinksys router which only has port 80 and 1434 udp opened. (Public Webserver not hacked yet). Eventually, I added all permissions for my self (admin). I right clicked on my new database ("WebWizforums") IE not real database name. I added permissions under my user name and granted all permissions.It's only my user name in permissions noone else. I'll tighten ship perms after I see that she works...

Forum software is what I want to try http://www.webwizguide.com/webwizforums/kb/sql_server_install.asp seems real easy but I can't figure it out? MS Access I knew inside and out but now ...no more MSDE or MSJet on Longhorn OS.

Can anyone explain this simple task "Clearly?" Pretend I have no idea what I'm doing .... Smile Thanks Gates for forcing my higher "edgeamycashun."

SQL Express for dummies!

Learning SQL is like filing tax returns...put it off to the last minute!

Mike C

|||

Ok, I triple checked everything then I rebooted....now it works? I guess start and stop will be learned as stupid sql tricks.

ok, I added the database tables with no problems however, I get this message when I log into the (ADMIN.asp) page

Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.

Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp

Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute

I searched for Common.asp and right clicked it. It has READ at min. So next is connection String?

I got yarn? but no connection.

Getting closer Watson.

Mike

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Hi all,

Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?

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 ''. The user is not associated with a trusted SQL Server connection.

Here is my code and i am using windows authentication:

<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>

<%

Dim connAkaki As SqlConnection
Dim cmdSelectAuthers As SqlCommand
Dim dtrAuthers As SqlDataReader

connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki")


connAkaki.Open()

cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
dtrAuthers= cmdSelectAuthers.ExecuteReader()


While dtrAuthers.Read()
Response.Write("<li>")
Response.Write(dtrAuthers("Firstname"))

End While

dtrAuthers.Close()
connAkaki.Close()

%>

Have you added the ASP.Net service account as a user in SQL Server? The error message is saying that the current user that is trying to connect has not been registered as a login in SQL Server.|||Hi there,

I was going to reply to your earlier post on the same/similar topic but since this one's newer I will post here.

The username with which the ASP.NET web application runs is different to the username you used to log into the computer with so chances are that the user is not defined in SQL Server's list of logins and so you get problems when using Windows Authentication.

A way around this is to use SQL Server authentication when trying to access your SQL Server. If you do this, your connection string will be:

connAkai = new System.Data.SqlClient.SqlConnection("Server=.\\NATHAN;database=Northwind; User ID=<SQL Server Login>; Password=<Password For Login>");

In a production system you would probably do more to secure that password (i.e. don't place it plain-text in the code) like putting it in the registry or some other methods but as an example I think it will do.

Hope that helps a bit, but sorry if it doesn't

|||

The SQL Server system by default is set to use only Windows Accounts and not SQL Server authentication, you can turn it on but I would leave it as is and use the windows accounts.

With ASP.Net generally the asp.net system by default runs under the Network Service account, to use it in the database you will need to make sure that the Network Service account has permissions for the database that you are using.

Another option is to make the asp.net application that you are working use a different account, this will help to secure your application. One way to do this is to reconfigure the application pool for the asp.net application that you have and make it run under the new account.

|||

Hi All!

How can add the ASP.Net service account as a user in SQL Server 2005?

|||

Huh? An MS Knowledge base article (http://support.microsoft.com/kb/555332) says just the opposite:

RESOLUTION

Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".

|||

Steps to change SQLExpress to "SQL Server and Windows Authentication Mode"

If you are lucky to have Microsoft SQL server Management Studio installed, then can browse to the SQL server Instance and right-click to bring up the Server Property. Server Property -> Security -> check "SQL Server and Windows Authentication Mode" option under "Server Authentication" section, and then restart the SQLExpress.

If you don't have Microsoft SQL server Management Studio installed, the if you are running on XP Professional, following SQL statements will do the same:

You have to first login to SQLExpress using osql utility.

USE [master]

GO

EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2

GO

Hope that will help.

Derek

|||

Hey Glen, I have the same problem only I can't get sqlexpress to allow me to logon in SQL Server Auth mode. I can't even logon using my server (in my house). It will let me log on in Windows Authentication but not SQL Server Authentication? I have nothing on this machine and I reininstalled SQL Express twice. I am the sole admin .

All I want to do is create a blank database (which I did) and log onto it. I watched video 7 on microsoft and opened my fireall udp and added me as doadmin. I added sqlbrowser.exe,sqlserver.exe and udp port 1434 for sql via web in windows firewall. I also opened port 1434 on my hardlinksys router which only has port 80 and 1434 udp opened. (Public Webserver not hacked yet). Eventually, I added all permissions for my self (admin). I right clicked on my new database ("WebWizforums") IE not real database name. I added permissions under my user name and granted all permissions.It's only my user name in permissions noone else. I'll tighten ship perms after I see that she works...

Forum software is what I want to try http://www.webwizguide.com/webwizforums/kb/sql_server_install.asp seems real easy but I can't figure it out? MS Access I knew inside and out but now ...no more MSDE or MSJet on Longhorn OS.

Can anyone explain this simple task "Clearly?" Pretend I have no idea what I'm doing .... Smile Thanks Gates for forcing my higher "edgeamycashun."

SQL Express for dummies!

Learning SQL is like filing tax returns...put it off to the last minute!

Mike C

|||

Ok, I triple checked everything then I rebooted....now it works? I guess start and stop will be learned as stupid sql tricks.

ok, I added the database tables with no problems however, I get this message when I log into the (ADMIN.asp) page

Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.

Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp

Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute

I searched for Common.asp and right clicked it. It has READ at min. So next is connection String?

I got yarn? but no connection.

Getting closer Watson.

Mike

Login failed for user . The user is not associated with a trusted SQL Server connection.

I've seen many, many, many, many posts regarding this topic - but none have been able to fully explain nor fix my problem.


I've developed a security solution according toScott Gu's guide and it works great - but only on my local machine running VWD and SQLExp2005. Once I move this application it completely breaks in the productions environment.

Today I managed to get it halfway there. I created a SQL login and changed my web.config to use these credentials - now the web application will come up, but none of my links (that are role based) are displayed - most likely because i'm authenticating as the SQL credentials instead of me.

So I switch it back to windows authenticated, as it is on my laptop, and it breaks again.

Please tell me theres a way to get this working in production and Scott's fantastic tutorial hasn't wasted me 2 weeks of work.

Here's the exact error I get when using Integrated authentication:

Server Error in '/Contracts' Application.

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

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 ''. The user is not associated with a trusted SQL Server connection.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): Login failed for user ''. The user is not associated with a trusted SQL Server connection.]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +437
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
System.Web.Security.SqlRoleProvider.GetRolesForUser(String username) +771
System.Web.Security.RolePrincipal.IsInRole(String role) +272
System.Web.SiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) +194
System.Web.SiteMapNode.IsAccessibleToUser(HttpContext context) +14
System.Web.StaticSiteMapProvider.GetChildNodes(SiteMapNode node) +348
System.Web.SiteMapNode.get_ChildNodes() +23
System.Web.SiteMapNode.get_HasChildNodes() +4
System.Web.SiteMapNode.System.Web.UI.IHierarchyData.get_HasChildren() +4
System.Web.UI.WebControls.Menu.DataBindRecursive(MenuItem node, IHierarchicalEnumerable enumerable) +4225
System.Web.UI.WebControls.Menu.DataBindItem(MenuItem item) +277
System.Web.UI.WebControls.Menu.PerformDataBinding() +117
System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect() +82
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.Menu.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.Menu.EnsureDataBound() +29
System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e, Boolean registerScript) +21
System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e) +22
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

I am not saying it will fix it but it maybe related to your Windows User/Group not having permission in the database when using Windows Authentication. The database permissions are in the new security section in the database in Management Studio. Hope this helps.|||Can you post your Web.config file?sql

Friday, March 23, 2012

Login failed for user ''(null)''

Hi,

(First, I should explain that I am not sure whether this is the right part of the forum for this message. My apologies if I'm in the wrong place. If this is the case, could you please let me know where this post should be? Thank you.)

I have a vew that accesses data from a linked server. The view works properly in Query Analyzer but fails when run by a .Net application. The message returned is:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

The linked server has the following attributes:

Server Type: SQL Server

Security: No local logins listed. Connections are made using the login's current security context.

Any help would be appreciated. Thank you.

Resolved. The problem was in two places: I had to remove Anonymous access from the directory in ISS (ISS/Directory/Properties/Directory Security/Edit) and change the login in the SQL Server service from Local Account to my login information (Start/Run/Services.msc/MSSQLSERVER/Log On/This Account). These changes allowed the link server to recognize and authenticate the login.

Monday, March 19, 2012

Login Failed

Can anyone explain why each time I want to connect to SQL server, I get this error:
Login Failed "WEBCOMPUTER\ASPNET"?(WEBCOMPUTER is my computer name)Because you are using integrated security, and by default, your ASP.NET pages run under the security context of the ASPNET Windows user. You need to add the ASPNET windows user as a user in SQL Server, or alternately, use SQL Server security and provide a username and password.

Friday, March 9, 2012

login and pass in a web.config

Hi!!

is there any way to get the login and password on my program′s web.config?

Full explain:

I have a sub report that is missing credentials.

In my tests, the sub report worked when I fill the login and password with a login and pass (mine, for example). But, this is not a good idea because the login and password would be changed when it′s system go to a production server. So I would need to deploy again with the new login and password.

Best regards!!

Pedro

try following:

<add key="RSServerUrl" value=http://urservername/reportserver/reportfolder />

-kushpaw

|||

But this is to put on my web.config,

I need put in my report′s datasource the login and password that is in my web.config.

Pedro

Logical Scan fragmentation ?

Can someone explain this statement ?
"An out of order page is one for which the next page indicated in an IAM is
a different page than the page pointed to by the next page pointer in the
leaf page."
Does this mean that DBCC checktable may result in some allocation errors ?Hi Hassan
No, this is not an error. The IAM indicates the next physical page and the
pointers indicate the next logical page. It just means that the a page is
out of order. :-)
So let's say your table is on page 82, 86 and 95. The IAM would indicate
them in that physical order. But it may be that the first rows in the index
are on page 95 (for example, valus A-G) then the next logical values are on
page 86 (values H - S) and the next are on page 82 (values T - Z). When you
are on page 86, the pointers will say that the next page is 82, but the IAM
will say that the next page is 95. This is just fragmentation, not an
error.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:egCGeILnDHA.1708@.TK2MSFTNGP12.phx.gbl...
> Can someone explain this statement ?
> "An out of order page is one for which the next page indicated in an IAM
is
> a different page than the page pointed to by the next page pointer in the
> leaf page."
> Does this mean that DBCC checktable may result in some allocation errors ?
>|||Read the whitepaper at:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/sql/maintain/optimize/ss2kidbp.asp
which should explain everything for you.
--
Paul Randal
DBCC Technical Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:egCGeILnDHA.1708@.TK2MSFTNGP12.phx.gbl...
> Can someone explain this statement ?
> "An out of order page is one for which the next page indicated in an IAM
is
> a different page than the page pointed to by the next page pointer in the
> leaf page."
> Does this mean that DBCC checktable may result in some allocation errors ?
>

Wednesday, March 7, 2012

logical modeling vs physical modeling

Can someone please explain this statement: At the logical level where there can be any number of entities in a relationship while physically you define relationships between two tables.

thx,

Kat

Take a n-m relation, an example would be a student entity and an lecture entitiy. A student can visit n lectures and a lectures can be visited by n students. Although the tables (entities) cannot be directly be related (only through the n-m table) the pure relation only exists between the students and the lectures entity. its the definition of an entity which make the difference between the understanding.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

Logical Design Question

Sorry for the long post but there is no way short way to explain this. So
read only if you have the time. If you take the time, I really, really
appreciate it.
Bill
I have a logical design situation that seems not to fit well in the
relational model (at least the way I am doing it – with no help from
triggers). I work for a group of commercial photographers who are contracte
d
to photograph events (graduations, races, fraternity social, etc.). They
offer Packages to their customers. A Package may consist of {4-5x7’s,
2-8x10’s, 16-Wallets}. The customer can choose the package as is or apply
an
Option to the package for a small additional price. An option is Black &
White, Sepia (antique), or Colorize. There are many options, but the
example I just gave is an Option Set from which only one selection can be
made. Another Option Set might consist of border styles to be applied aroun
d
each photo.
An option set and all its subsets are possible way to construct the options
that will be presented to the customer. For example, the example I just gav
e
you has 3 members. But there are 6 additional subsets of this set not
counting the empty set. So the maximum set of options and all its subsets
form an OptionGroup. Only one OptionSet from within an OptionGroup is
allowed to be set up as an option for Package.
Furthermore, an option can belong to only one OptionGroup. But, as
explained above, an option can belong to many OptionSet’s.
Here is the problem:
Given a Package table consisting of Package_ID as the PK, I need to
associate one or more OptionSet’s. I can associate multiple optional sets
to
the same package as long as they are from different OptionGroup’s.
If that associative table consists of Package_ID, OptionGroup_ID,
OptionSet_ID , Price columns with the first three columns as the PK, I
violate the business rule that only one OptionSet from the same OptionGroup
can be associated to the same package.
If I make Package_ID, OptionGroup_ID as the Primary key , I can enforce this
rule but the other relationships look weird. Here is what I came up with (i
f
you model these tables you will see the weirdness) . . .
OptionGroup (table)
OptionGroup_ID (PK)
OptionGroupName
OptionSet (table)
OptionSet_ID (PK)
OptionGroup_ID (FK) (non-identifying relationship with OptionGroup table)
Option_OptionSet (table)
OptionSet_ID (PK, FK) (identitying relationship with OptionSet table)
Option_ID (PK, FK) (identifying relationship with Option table)
OptionGroup_ID (FK) (non-identifying relationship with OptionGroup table)
Option (table)
Option_ID (PK)
OptionName
Package (table)
Package_ID (PK)
PackageName
PackageOptionSet (table)
Package_ID (PK, FK) (identifying relationship with Package table)
OptionGroup_ID (PK, FK) (identifying relationship with OptionGroup table)
OptionSet_ID (FK) (non-identifying relationship with OptionSet table)
PriceHave you ever been to this site:
http://www.datamodel.org/
ML
p.s. sometimes it's up, sometimes it's down...|||Well apparently it is down now, in any case, I prefer MSDN Groups.
"ML" wrote:

> Have you ever been to this site:
> http://www.datamodel.org/
>
> ML
> p.s. sometimes it's up, sometimes it's down...|||This might also help:
http://www.agiledata.org/essays/dataModeling101.html
ML|||I know how to model data. This is a particularly hard one to model, that is
why I am asking the question. I am looking for another's modeler's
perspective on this particular problem not how to model data.
"ML" wrote:

> This might also help:
> http://www.agiledata.org/essays/dataModeling101.html
>
> ML|||I'd choose an identifying relationship:
OptionSet (table)
OptionGroup_ID (PK,FK) (identifying relationship with OptionGroup
table)
OptionSet_ID (PK)|||You need to isolate relationships in your proposed Option_OptionSet and
PackageOptionSet tables. It seems you started designing tables before you
laid out the entire logical model.
Try something like this (<-- = 'one to many'):
1)
Package <-- Photo <-- OptionSet --> OptionGroup
OptionSet <-- Option
or:
Package <-- Photo
Package <-- OptionSet --> OptionGroup
OptionSet <-- Option
2)
Photographer <-- Customer (don't know if you really need this)
Customer <-- Package
ML|||ML, AK,
Using your notation (< is the one side and -- is the many side), the correct
relationships are:
OptionGroup<--OptionSet <-- Option
Package <-- PackageOptionSet --> OptionGroup
The problem with the first relationship is that you can have groups 1 and 2
which is ok. You can have options A and B which is also OK. You can have
1,A and 2,A in OptionSet which not OK. An option can only belong to one
group.
Assuming we have Options assigned to only one group we still have a problem
with the second relationship. For example, suppose we have the OptionSet
{1,A; 1,B; 1, C} called OS1 and OptionSet{1,A; 1,B} called OS2 (the first
number is the group id and the 2nd number is the Option id). This is OK.
The 2nd relationship permits the record -- P1,1,OS1 and the record --
P1,1,OS2 in PackageOptionSet which is not Ok. Only one option set from a
group can be assigned to a Package (P1 is the Package ID, 1 is the Group ID,
and OS1 or OS2 is the assigned option set.)
The above situation is an example of offering the Options of Black & White,
Sepia, and Colorize for one package but only offering Black & White, Sepia
for another package. You don't want the possibility of both option sets be
assigned to a package.
Bill
"ML" wrote:

> You need to isolate relationships in your proposed Option_OptionSet and
> PackageOptionSet tables. It seems you started designing tables before you
> laid out the entire logical model.
> Try something like this (<-- = 'one to many'):
> 1)
> Package <-- Photo <-- OptionSet --> OptionGroup
> OptionSet <-- Option
> or:
> Package <-- Photo
> Package <-- OptionSet --> OptionGroup
> OptionSet <-- Option
> 2)
> Photographer <-- Customer (don't know if you really need this)
> Customer <-- Package
>
> ML|||In general, requesting solutions for data design problems in newsgroups is
somewhat risky since there is a fair chance that several aspects of the
business model is misunderstood and miscommunicated. Since your exact
requirements are transparent to others in this group the suggested solutions
can sometimes be misguided as well. If this is a critical project, I would
suggest you s the help of an experienced and trained professional who can
have direct access to your business model and data requirements.
With that preface, can you explain your tables a bit more elaborately? Based
on what I understood, Optiongroup is just a derivable resultset out of
existing data, right? Why not use a view for displaying the data to the
customers? Is the set of options time-varying -- if not, based on your
descriptions, aren't the options really attributes rather than entities?
Anith|||I know it is very hard to understand business rules communicated in this way
and just as hard to figure out a way to present the rules. While it is
obvious to me, that is because I have worked this busines so long.
An OptionGroup is not a derviable resultset. Options exists independently
and some are mutually exclusive for example you can't have Black & White and
Sepia on the same photo.
For example one OptionGroup ( call it the Tone Group) consist of these
OptionSets:
{BW, Sep, Cz}
{BW, Sep}
{BW, CZ}
{Sep, CZ}
{BW}
{Sep}
{CZ}
Only one of these sets can be assigned to an Package. The concept of an
OptionGroup came into being soley as way to facilitate this rule. If all
these OptionSets belong to a the same group, the application and database
have a way to know that only one option set from a group can be assigned to
a
package. Also the OptionGroup facilitate the user being able to offer
different combinations of the same options.
The concept of a OptionSet came into being as way for the application to
know that when presenting a set of options from the same option set only one
choice is allowed.
Suppose you have another Option Group called Border consisting of:
{FC, BN}
{FC}
{BN}
It is permissble to assign {BW, Sep} and {FC} as option sets. The
application know these are from different groups. At order taking time, the
application knows to present BW and SEP as a one choice and FC as a another
choice. So the customer can choose (BW and FC ) or (SEP and FC) or (just BW
or just FC) but not (BW and Sep).
I hope this helps
"Anith Sen" wrote:

> In general, requesting solutions for data design problems in newsgroups is
> somewhat risky since there is a fair chance that several aspects of the
> business model is misunderstood and miscommunicated. Since your exact
> requirements are transparent to others in this group the suggested solutio
ns
> can sometimes be misguided as well. If this is a critical project, I would
> suggest you s the help of an experienced and trained professional who c
an
> have direct access to your business model and data requirements.
> With that preface, can you explain your tables a bit more elaborately? Bas
ed
> on what I understood, Optiongroup is just a derivable resultset out of
> existing data, right? Why not use a view for displaying the data to the
> customers? Is the set of options time-varying -- if not, based on your
> descriptions, aren't the options really attributes rather than entities?
> --
> Anith
>
>