Showing posts with label iis. Show all posts
Showing posts with label iis. Show all posts

Tuesday, March 20, 2012

Cannot open SQLServer Databaer Under IIS

ConnectionString is below.

Dim objDb As New SqlConnection("Data Source='(local)';trusted_connection=true;Initial Catalog=classdb")

This ConnectionString occurs DB-Open-Error. Why?

Show me the Solution.

what xactly is the error message ?
|||

Try this url for samples. Hope this helps.

http://www.carlprothman.net/Default.aspx?tabid=81

Monday, March 19, 2012

Cannot open database "testDB" requested by the login. The login failed.

I have created a new database within SQLServer Express 2005 and have an ASP page in IIS. Any time i attempt to access the database I get the following error:

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "testDB" requested by the login. The login failed.

The ODBC connection that I have created works fine if connecting to the same table (literally three sample fields with two records) in an Access database.

The database connection that I am using is:

Set DatabaseConnection = Server.CreateObject("ADODB.Connection")
DatabaseConnection.Open "DSN=testDB;UID=EINSTEIN\Administrator&pwd=password;DATABASE=testDB;APP=ASP Script"
Set rs = Server.CreateObject("ADODB.recordset")
SQLString = "SELECT * FROM testTable"
rs.Open SQLString, DatabaseConnection
if NOT rs.EOF then
Response.Write(rs("testField1") & " - " & rs("testField2"))
end if
rs.Close
DatabaseConnection.Close
Set DatabaseConnection = Nothing

EINSTEIN is the name of the server, rs = Recordset. I have tried changing to just Administrator instead of machinename\Administrator with no success. I have got SQL Server Management Studio Express CTP, and can log in fine to SQL Server using EINSTEIN\Administrator.

Please can anyone help!

Suggesting that you are going the DSN-less way (Connectionstrings can be found here www.connectionstrings.com) the database which is requested is not available for this user. You cannot provide a Windows User name if you want to use trusted authentication (it some time ago, that I used DSN, but I guess this is just possible for passing over SQL Server authentication. Try using a DSN-less connection with specifying a database that is accessible for the user.

See if that works, Jens Suessmeyer.

|||

It looks like your connection string may be a little incorrect, the current string is:

"DSN=testDB;UID=EINSTEIN\Administrator&pwd=password;DATABASE=testDB;APP=ASP Script"

It should be

"DSN=testDB;UID=EINSTEIN\Administrator;pwd=password;DATABASE=testDB;APP=ASP Script"

No Ampersand between Administrator&pwd, instead it should be a semi-colon

See if that works

Cannot open database "Northwind" requested by the login. The login failed............. ERR

Please, can anyone tell me why I am getting the undermentioned error message when I develop my application as an IIS Site in Visual Web Developer 2005 Express ? I have already developed and successfully tested it as a 'FileSystem Web Site' .
I am using SQLSErver Express 2005 edition and have which I have installed along with the Northwind database as per the download instructions.
My IIS software is version 5.1 which I have checked and it is configured to allow Integrated Windows Authentication.


the relevant code is
(1) web.config file connection strings

<connectionStrings>

<addname="NorthwindConnectionString"

connectionString="Data Source=.\sqlexpress;Initial Catalog=Northwind;Integrated Security=True"

providerName="System.Data.SqlClient"/>

</connectionStrings>


(2) the grid view control and sqldatasource

<asp:GridViewID="GridView1"runat="server"AutoGenerateColumns="False"DataKeyNames="CategoryID"

DataSourceID="SqlDataSource1">

<Columns>

<asp:BoundFieldDataField="CategoryID"HeaderText="CategoryID"InsertVisible="False"

ReadOnly="True"SortExpression="CategoryID"/>

<asp:BoundFieldDataField="CategoryName"HeaderText="CategoryName"SortExpression="CategoryName"/>

<asp:BoundFieldDataField="Description"HeaderText="Description"SortExpression="Description"/>

</Columns>

</asp:GridView>

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"

SelectCommand="SELECT [CategoryID], [CategoryName], [Description] FROM [Categories]">

</asp:SqlDataSource>


This is the full error message and details:

Server Error in '/sqlservertest' Application.

Cannot open database "Northwind" requested by the login. The login failed.
Login failed for user 'JERRY-3C9615BAA\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: Cannot open database "Northwind" requested by the login. The login failed.
Login failed for user 'JERRY-3C9615BAA\ASPNET'.
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): Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'JERRY-3C9615BAA\ASPNET'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +684883 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +207 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1751 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +32 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +601 System.Data.SqlClient.SqlInternalConnectionTds..ctor(SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +159 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +346 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +445 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +304 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1837 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +129 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +41 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1787


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

I think you don't understand State Management in Asp.net because when you are using SQL Server your application is not a File System application. What I am saying is
SQL Server Asp.net application is not a file system application. So Asp.net is trying to connect to Northwind database in SQL Server without permissions. It is permissions
because there are two permissions in SQL Server, the server permission and the database permission. Hope this helps.

Cannot open database "mydatabse" requested by the login..

i was using .net's internal server as a my web server(local)

now i have changes it to IIS(local)

but now i amgetting an error like

Cannot open database "mydatabse" requested by the login. The login failed.
Login failed for user 'SV2\ASPNET'

'SV is my achine name ASPNET is a login in the directory in seccurity/logins in sql server management studio

what can i do?

Hi,

Are you sure you have given the machinename\aspnet account the required permissions

http://forums.asp.net/p/905865/1001573.aspx

At times, adding <identity impersonate="true"/> to the web.config helps you to impersonate the user acccessing the application

Also check your connection string.

HTH,
Suprotim Agarwal

--
http://www.dotnetcurry.com
--

|||

Is your database on a different machine than your web server? If so, you need to give the account that the web application is running under access to the database.

|||

Hi,

Your connection string is set to use windows authentication or logged in user credentials, either change it to use SQL username password.

Saturday, February 25, 2012

Cannot install server components

I have the beta version of RS running fine on Windows 2000 Server (SP4), IIS 5, and SQL Server 2000 Enterprise (SP3a). No issues at all.
However, when trying to install the RS release candidate, for some reason I am not presented with the server components option - I can only see the client tools option.
Can anyone assist?Did you receive any prereq warnings?
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ravinder" <Ravinder@.discussions.microsoft.com> wrote in message
news:0E870307-157B-4509-9003-B6CC934C4DDB@.microsoft.com...
> I have the beta version of RS running fine on Windows 2000 Server (SP4),
IIS 5, and SQL Server 2000 Enterprise (SP3a). No issues at all.
> However, when trying to install the RS release candidate, for some reason
I am not presented with the server components option - I can only see the
client tools option.
> Can anyone assist?|||I finally got the install working properly. As a last resort I re-installed Win2k SP4 and low and behold I am now able to install RS Server Components without any issues at all.
Microsoft might want to add this "known issue" to the install notes.
"Daniel Reib [MSFT]" wrote:
> Did you receive any prereq warnings?
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Ravinder" <Ravinder@.discussions.microsoft.com> wrote in message
> news:0E870307-157B-4509-9003-B6CC934C4DDB@.microsoft.com...
> > I have the beta version of RS running fine on Windows 2000 Server (SP4),
> IIS 5, and SQL Server 2000 Enterprise (SP3a). No issues at all.
> >
> > However, when trying to install the RS release candidate, for some reason
> I am not presented with the server components option - I can only see the
> client tools option.
> >
> > Can anyone assist?
>
>

Cannot install June CTP on Windows 2003 DC !!!

I am trying to install Sql Server 2005 June CTP on a Windows Server
2003 SP1 primary domain controller with IIS/ASP installed.

I get this error (when Sql Server Database Services is being installed:
"SQL Server Setup was unable add user NT AUTHORITY\NETWORK SERVICE to
local group SQLServer2005MSSQLServerADHelp­erUser".
And I am not alone!
See http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=18788

Any workaround or update to be able to install it on a domain controller, Microsoft?

Thanks!

Anybody?

Our environment requires installation of SQL 2005 on a server with Active Directory... so this is really a big issue.

Please, can somebody from MS look into this?|||We are a few days later now, and still, nowhere on the Internet I can find a solution.

Can somebody from Microsoft please respond?|||

Currently SQL Server 2005 will not install on a Domain Controller or on Windows Small Business Server. There is no known work around at this time other than installing on a machine that is not configured as a domain controller. This is a known issue and we're working on resolving it.

Dan

|||Yikes, this is a huge issue. I have this issue too on a single Win2K3 Server Standard with SP1, AD/DC. Active Directory and DC are required before setting up TFS.Tongue Tied
|||I've been in contact with the TFS team on this issue. As long as you use the April CTP that shipped with TFS Beta 2 you're okay. You just can't use the June CTP.

Thursday, February 16, 2012

Cannot get RDA.Pull to work

[SQL Everywhere CTP],[VS2005]

RDA.Pull method is not doing anything for me from a VSTO 2005 Outlook addin project. I have IIS & SQL Server 2005 running on my develpoment pc. I am using Integrated Windows Auth for vdir. It just stops execution at the line of code that calls RDA.Pull & doesnt return any tables nor throws an error. I have no idea where I am going wrong. I have tried using table names that dont exist in the .sdf too.

SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess();

rda.InternetUrl = @."http://localhost/WsRDA/sqlcesa30.dll";

rda.LocalConnectionString = @."Data Source=D:\_fullPahtHere\DBEverywhere.sdf;Password=sdfPwdHere";

rda.InternetLogin = "myLocalUserName";
rda.InternetPassword = "myLocalPassword";

rda.Pull("Class2", "select * from dbo.Class", @."Data Source=MyDesktop\SQL2K5;Initial Catalog=ServerDB;Integrated Security=SSPI");

Without an error msg, I dont know what the problem is. Any ideas?Ok, figured out. My connection string was missing Provider=sqloledb attribute.