Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Thursday, March 29, 2012

Attach MySql database via internet

Hie !

Please, how to manage (attach,connect to) MySql database located on host server http://www.avanti.si from my home PC with Microsoft SQL Server Management Studio Express? This "http://www.avanti.si:8080\MySqlDatabaseName,3306" fail !

Thenks!

hi,

you should ask you provider about connection info..

assuming the "server" is named and available as "www.avanti.si" and 3306 is the port you have to use to connect to, you should provide that info in the SQL Server MAnagement Studio Express connection dialog as

www.avanti.si,3306
in the server property, and provide your SQL Server standard login and pwd.. in the "options" tab you can, but is not mandatory as the <default> value will be resolved as tcp/ip, set the network protocol as tcp/ip and specify the "connect to database" property to "MySqlDatabase", but this one should be resolved as well without your intervention becouse you should be usually only grated db access to your db, MySqlDatabase...

you have to verify the www.avanti.si is the actual SQL Server instance name as well, and I doubt about it..

regards

|||

Actually, you can't connect directly to MySQL database, Management Studio is designed for use with SQL Server. You can create a linked server to any database that offers an OLEDB provider, which I believe MySQL has. The linked server will allow you to query your data from MySQL, but not manage the database.

Regards,

Mike

|||

ooppss...

did not notice/intended MySqlDatabase as a "MySql.. database"

thank you Mike

Monday, March 19, 2012

Assistance with Stored Procedure and ASPX Page Needed

Hello, I have the following stored procedure and the following aspx page. I am trying to connect this aspx page to the stored procedure using the SqlDataSource. When the user enters a branch number in textbox1, the autonumber generated by the database is returned in textbox2. I am not quite sure what to do to get this to execute. Can someone provide me assistance? Will I need to use some vb.net code behind?

Stored Procedure

CREATE PROCEDURE InsertNearMiss @.Branch Int, @.Identity int OUT ASINSERT INTO NearMiss (Branch)VALUES (@.Branch)

SET @.Identity = SCOPE_IDENTITY()

GO

ASPX Page

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:NearMissConnectionString%>" InsertCommand="InsertRecord"InsertCommandType="StoredProcedure"SelectCommand="InsertRecord" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:ControlParameterControlID="TextBox1"Name="Branch"PropertyName="Text"Type="Int32"/> <asp:ControlParameterControlID="TextBox2"Direction="InputOutput"Name="Identity"PropertyName="Text"Type="Int32"/> </SelectParameters> <InsertParameters> <asp:ParameterName="Branch"Type="Int32"/> <asp:ParameterDirection="InputOutput"Name="Identity"Type="Int32"/> </InsertParameters> </asp:SqlDataSource> <asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>

<asp:TextBoxID="TextBox2"runat="server"></asp:TextBox>

Here's all about getting the value of the most recently added record:http://www.mikesdotnetting.com/Article.aspx?ArticleID=54

SqlDataSource options are about 3/4 of the way down.

|||

It appears you are only doing an insert, so you can get rid of the whole <selectParameters> collection. In this case, I would create a handler for onInserted and have the handler insert the output value from the procedure into the textbox 2 box. To fire the event, put a button that has an onclick event handler that calls SqlDataSource1.Insert(). This fires the insert command of the datasource. Below is an example page and codebehind

12 id="testSource"3runat="server"4InsertCommand="usp_ins_test"5InsertCommandType="StoredProcedure"6ConnectionString='<%$ ConnectionStrings:test %>'7OnInserted="testSource_Inserted">89"TextBox1" Name="prm_b" Direction="Input" Type="int32" PropertyName="Text">10"prm_r" Direction="Output" Type="Int32">111213branch: "TextBox1" runat="server">
14returnedvalue: "TextBox2" runat="server">15"btnSubmit" runat="server" Text="Add New Branch" OnClick="btnSubmit_Click"/>
 Code Behind:
 
protected void btnSubmit_Click(object sender, EventArgs e) {if (Page.IsValid) { testSource.Insert(); } }protected void testSource_Inserted(object sender, SqlDataSourceStatusEventArgs e) {if (e.Exception !=null)//display an error message to the screen e.ExceptionHandled =true;else TextBox2.Text = e.Command.Parameters["@.prm_r"].Value.ToString(); }

That should do it.

--D

Assistance in connecting a SQL Server Client to SQL Server sitting in a shared environment

Hi,

I need to connect to a SQL server thats running in say abc.trident.com and also sits in a shared environment..

I have couple of questions

1) That SQL server is accessible from my network, yet when I swtich on my enterprise manager I am unable to view that in the list of running SQL servers in the populated list.

Is it because its sitting in a shared environment I am unable to view that?

2) What is the connection striing I should use to connect to the server..When I try to configure a SQL server registrations it normally asks for SQL Server name along with the user authentication

Should I mention fill the Server: field as

abc.trident.com

or

// abc.trident.com/abc.trident.com

to connect to the clustered server.

Can some one tell me the proper connection string if both aforementioned ones are incorrect?

Thanks in Advance

What error it throws !?

1) That SQL server is accessible from my network, yet when I swtich on my enterprise manager I am unable to view that in the list of running SQL servers in the populated list.

Is it because its sitting in a shared environment I am unable to view that?

>> Is this server is out side your network!!!? have you tried connecting using QA? is NET DDE and NET DDE DDSM service are running ? Is NETBIOS enabled?

2) What is the connection striing I should use to connect to the server..When I try to configure a SQL server registrations it normally asks for SQL Server name along with the user authentication

Should I mention fill the Server: field as

abc.trident.com

or

// abc.trident.com/abc.trident.com

to connect to the clustered server.

Refer connectionstring.com for different connection strings.

Regards

Hemantgiri S. Goswami

|||

1) is NET DDE and NET DDE DDSM service are running ? Is NETBIOS enabled?

Yes

2) The connectionstring.com site appears to be dead and has some irrevlant ads. can you tell me if my connection string format to represent a Clustered SQL server is correct or any other site from which I can get the accurate info

Efforts in googling ended in vain.

3) The error

<SQLServer does not exist or access denied ConnectionOpen.connect())>

Here the SQL server lies out side my network and the network is even accessible from a Tracert.

but the SQL server is up and running according to the Admin.

|||No takers!|||

Hi,

You have said that the server is outside network.... If it is behind firewall have you check the proper firewall rule is placed in order to get you access !? and Port too...

Refer this KB for the workaround http://support.microsoft.com/kb/328306/en-us

Hemantgiri S. Goswami

Saturday, February 25, 2012

Assembly not found in SQL Catalog for VSS

I'm trying to connect to VSS from my CLR procedure.

I'm getting this error..

Assembly

'microsoft.visualstudio.sourcesafe.interop, version=5.2.0.0,

culture=neutral, publickeytoken=b03f5f7f11d50a3a.' was not found in the

SQL catalog.


I added reference to VSS dll by opening the project file in notepad, as I couldn't right-click and do an add reference.


Here's the code...

using System;

using System.Data;

using System.Data.SqlClient;

using System.Data.SqlTypes;

using Microsoft.SqlServer.Server;

using Microsoft.VisualStudio.SourceSafe.Interop;



public partial class StoredProcedures

{

[Microsoft.SqlServer.Server.SqlProcedure]

public static void PrintToday()

{

try

{

//'— The SourceSafe INI file.

string iniVssPath = "C:/CLRVSS";


//'— The SourceSafe User ID/Password.

string cVSSUserName = "Admin";

string cVSSPassword = "";



VSSDatabaseClass vssLib = null;

vssLib = new VSSDatabaseClass();

vssLib.Open(iniVssPath, cVSSUserName, cVSSPassword);


VSSItem VSS_Item = vssLib.get_VSSItem("$/Test", false);

VSS_Item.Destroy();


SqlPipe p;

p = SqlContext.Pipe;

p.Send("success");

}

catch

{

SqlPipe p;

p = SqlContext.Pipe;

p.Send("error");

}

}

};

from BOL 2005 (April), CREATE ASSEMBLY (Transact-SQL):

Assembly Validation

SQL Server performs checks on the assembly binaries uploaded by the CREATE ASSEMBLY statement to guarantee the following:

The assembly binary is well formed with valid metadata and code segments, and the code segments have valid Microsoft Intermediate language (MSIL) instructions.

The set of system assemblies it references is one of the following supported assemblies in SQL Server: Microsoft.Visualbasic.dll, Mscorlib.dll, System.Data.dll, System.dll, System.Xml.dll, Microsoft.Visualc.dll, Custommarshallers.dll, System.Security.dll, System.Web.Services.dll, and System.Data.SqlXml.dll. Other system assemblies can be referenced, but they must be explicitly registered in the database.

For assemblies created by using SAFE or EXTERNAL ACCESS permission sets:

The assembly code should be type-safe. Type safety is established by running the common language runtime verifier against the assembly.

The assembly should not contain any static data members in its classes unless they are marked as read-only.

The classes in the assembly cannot contain finalizer methods.

The classes or methods of the assembly should be annotated only with allowed code attributes. For more information, see Custom Attributes for CLR Routines.

|||

Visual Studio does not automatically register all references. That is the reason you are not allowed to add arbitrary references to your SQL Server project. You can add references to only supported .NET framework assemblies or assemblies that are already registered in the database.

What you need to do in this case - Register the assembly you want to refer in the database and then add a reference to it.

Thanks,

-Vineet.

AspX Page Connection Error using sqlserver

Dear i am using visual studio.net........ when i connect database (in sqlserver) using sqldataAdapter with datagrid in visual basic.net every thing work properly......... but when i use the same in asp.net then i get an error message on the resultant explorer page give below.

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

Login failed for user 'RAMIZSARDAR\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 'RAMIZSARDAR\ASPNET'.

Source Error:

Line 85: 'Put user code to initialize the page here
Line 86: Dim ds As New DataSet()
Line 87: SqlDataAdapter1.Fill(ds)
Line 88: DataGrid1.DataSource = ds.Tables(0)
Line 89: DataGrid1.DataBind()

Source File: c:\inetpub\wwwroot\studentData\WebForm1.aspx.vb Line: 87

Stack Trace:

[SqlException: Login failed for user 'RAMIZSARDAR\ASPNET'.]
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
studentData.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\studentData\WebForm1.aspx.vb:87
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0

Plz solve my problem and Reply me on ramiz_ch@.hotmail.com
Plz solve my problem and Reply me on ramiz_ch@.hotmail.com
Plz solve my problem and Reply me on ramiz_ch@.hotmail.com

Ramizwell, yes. if you use the same code in VB.NET/WIndows forms it'll run under the security context of the currently logged-in user. i.e. YOU.

under ASP.NET it runs by default as the ASP.NET guest account, MACHINENAME\ASPNET

you need to add ASPNET to the SQL Server permissions list, OR run ASP.NET as a different user, OR specify a SQL Server auth account in your connection string.

this question has been covered over and over in these forums. try the FAQ, if it's not in there I'll be shocked and amazed.

Friday, February 24, 2012

ASPNETDB.MDF & SQL Server

When I first sign up with Visual Web Developer, Do I continue to use this database ASPNETDB.MDF or do I need to connect to the Microsoft SQL Server Database? Does Visual Web Developer Express automaticaliyy connect to SQL Server Express Edition?

Thanks

Computergirl

SQL Express only allows a single connection, and no hosting company are using this version. It depend on what your purpose, if it's only for self learning, then it's OK.

Visual Web Developer Express does not automatically connect to SQL Express.

More info on how to setup the connection string:http://msdn2.microsoft.com/en-us/library/ms247257(VS.80).aspx

ASPNETDB replaces my database in connection

Hi,
I've a little problem. When I connect my local server by this connection string:Data Source=NB126\SQLEXPRESS;Initial Catalog=TVRM;Integrated Security=TrueI get content of ASPNETDB.MDF (placed in App_Data directory) instead content of my own database named TVRM. Please help...

Hi ciTrus,

Are you sure your connection string is actually used when connecting to database?(a small trick here is that, assign a wrong server name which doesnot exist to your connection string and test again. see if your data still can be populated).

Rember that there is a default "AspNetSqlMembershipProvider" in you machine.config and if you are using sql express, this provider will direct your membership database to App_Data folder silently (which i think is the case you are currently in). If you want to use a custom membership database, you need to add a new membership provider and put it to your web.config.

like: <system.web>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
<providers>
<remove name="AspNetSqlProvider" />
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName=HERE IS YOUR CONNECTION STRING NAME
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
passwordFormat="Hashed"
applicationName="/" />
</providers>
</membership>
</system.web>

Hope my suggestion helps

|||

Bo Chen,
thank you very much. I did exactly what you wrote and it worked.Big Smile

CiTrus

ASPNETDB relation with my databas

HI!
I have a ASPNETDB as my login databas. but now i want to connect this databas or the aspnet_user table to my table, how do i?
I want to check the username in aspnet_user table and select the same username in my table?

I want to write all sql code in a sql file. so i want to know how i can connect to the sql file from my c# code?

I hope somebody understand me...

Hi sallad88,

I want to write all sql code in a sql file. so i want to know how i can connect to the sql file from my c# code?

Not 100% sure what you mean by this, but if i understand you correct, you can write a stored procedure for this. Since what you want is to "check the username in aspnet_user table and select the same username in my table", you can write your stored procedure like this:

create procedure sp_check_name

as

select * from My_own_table
where Firstnamein

(select username from [asp.net db].dbo.aspnet_users ) // you can access asp.net db this way (specify the database name, schema name, table nameexplicitly)

And in your application, you can bind your sqlcommand to this stored procedure and call executereader function. This will return you desired result set.

Hope my suggestion helps

|||

Yes that was one thing...

And its work fine, I will come back when i can explain the other things better and when iam there in my application...

Thanks for know

ASPNETDB - Unable to connect to SQL Server database

Hi Eevryone:

I seem to have corrupted my ASP.netWeb Site Administration Tool some how. It worked fine a few days ago, but reloaded SQL Server 2005 Express Edition W Adv Services SP1 yesterday I can not get past the "Unable to connect to SQL Server database" error. I have run the aspnetdb.exe and created both a aspnetdb.mdf and loaded the tables to into a existing mdf. I have checked all the permissions.

So any ideas on what I am doing wrong, or can you point me to some documentation on the 'AspNetSqlProvider'

Thanks in advance, Gene

You could erase the file in the appdata directory and it should recreate one fromscratch for you. actually, all you need is

<roleManager enabled="true" />

to get it to make the appdata express file

|||Exactly were do I am this entry?|||

Here is a very simple web.config with rolemanager enabled.

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="FetchEmailConnectionString" connectionString="Data Source=TM8200;Initial Catalog=FetchEmail;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<roleManager enabled="true"></roleManager>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>

|||

Thanks again for the help.

Your sample web.config helped prove what I was beginning to suspect yesterday. It is the creation of user instances under .SQLExpress that is causing my problems. This makes sense considering that it was after I switched to .SQLExpress from SQL 2000 that my problems started. Any suggestions on where to find good user instance documenation? So far I have not found any good trouble shooting articles.

Cheers, Gene

ASPNET User

My application attempts to connect to an SQL Server database as name ASPNET
and Login Name SERVERNAME/ASPNET in response to these commands:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET
with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the
name ASPNET but eliminates the login name. How do I create the correct user
so that my application can log in?
Many thanks.
re:
> I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ?
Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change
the SQL Server's security to "SQL Server and Windows",
instead of "Windows", create a SQL Server login for your database,
and assign it the permissions you want it to have.
You'd have to change the connection string to use either
the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful :
http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure you read this:
http://weblogs.asp.net/AChang/archiv...15/113866.aspx
(In fact, read that even if your SQL Server is in the same machine as your web server)
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
> My application attempts to connect to an SQL Server database as name ASPNET and Login
> Name SERVERNAME/ASPNET in response to these commands:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
> Catalog=MCSCRE;Integrated Security=SSPI");
> myConnection.Open();
> However, the user of this database is ASPNET. I can't create a user ASPNET with a login
> name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNET but
> eliminates the login name. How do I create the correct user so that my application can
> log in?
> Many thanks.
>
>
|||You are right that the '/' is a typo. The basic problem is exactly the one
discussed in the Q316989 that you reference below. Following that article I
changed SQL Server's security to "SQL Server and Windows". I created a new
user of my database and modified my application connection string as
follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in
Q316989 fails in the same way. It is as though I need a user for SQL Server,
and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
> re:
> You should be able to.
> Are you sure that's not SERVERNAME\ASPNET ?
> Notice the difference in the slash's direction.
> Other than that, which is probably a typo, you could change
> the SQL Server's security to "SQL Server and Windows",
> instead of "Windows", create a SQL Server login for your database,
> and assign it the permissions you want it to have.
> You'd have to change the connection string to use either
> the loginname/password you created, or a Trusted Connection.
> You'll find this to be helpful :
> http://support.microsoft.com/default.aspx?kbid=316989
> If the SQL Server is in a different machine that the web server, make sure
> you read this:
> http://weblogs.asp.net/AChang/archiv...15/113866.aspx
> (In fact, read that even if your SQL Server is in the same machine as your
> web server)
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
>
|||re:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);
> Initial Catalog=MCSCRE;User ID=Logger;password=admin");
I've had problems connecting when I use (local) for the SQL Server's name.
Check and see what the real name of your SQL Server instance is,
and use *that* name in your connection.
To check the instance name of your SQL Server, double-click the
SQL Server Service Manager icon in your taskbar, or open the
"Service Manager" app in the "Start Menu", "Programs",
"Microsoft SQL Server" start menu menu group.
The "Server" textbox will tell you the real name for your SQL Server instance.
Try using *that name* in your connection string, instead of (local).
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
> You are right that the '/' is a typo. The basic problem is exactly the one discussed in
> the Q316989 that you reference below. Following that article I changed SQL Server's
> security to "SQL Server and Windows". I created a new user of my database and modified
> my application connection string as follows:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
> Catalog=MCSCRE;User ID=Logger;password=admin");
> It still fails with the same error. Even the three line test program in Q316989 fails in
> the same way. It is as though I need a user for SQL Server, and then a second one for
> the database.
> Any idea what is going on here?
> Many thanks,
> Andrew
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
>
|||The latest saga..
Instead of a new user for my database and loging in as him I logged in as
'sa' (the deafult SQL user) from my app. That works!
Is it the case that my ap. was failing to log in to SQL server, rather than
inot my database? Obviously, I am new to SQL Server authentication and it is
proving counter intuitive to me.
Thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
> re:
> I've had problems connecting when I use (local) for the SQL Server's name.
> Check and see what the real name of your SQL Server instance is,
> and use *that* name in your connection.
> To check the instance name of your SQL Server, double-click the
> SQL Server Service Manager icon in your taskbar, or open the
> "Service Manager" app in the "Start Menu", "Programs",
> "Microsoft SQL Server" start menu menu group.
> The "Server" textbox will tell you the real name for your SQL Server
> instance.
> Try using *that name* in your connection string, instead of (local).
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
>
|||re:
> Instead of a new user for my database and loging in as him I logged in as 'sa' (the
> default SQL user) from my app. That works!
That explains a lot.
The "sa" user has read/write permissions to *all* SQL Server's databases.
Your problem is *not* the login, but that the user your connection is trying
to *login as* doesn't have permissions to the objects for the database you're
trying to use.
Add the login you want to use to SQL Server and then add that user to your
database's users, and then assign permissions for that database's objects to
your new user.
This is an object-by-object assignment.
Make sure that all the relevant permissions to all needed objects are assigned.
Then, you should have no problem with that new user accessing your db.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
> The latest saga..
> Instead of a new user for my database and loging in as him I logged in as 'sa' (the
> deafult SQL user) from my app. That works!
> Is it the case that my ap. was failing to log in to SQL server, rather than inot my
> database? Obviously, I am new to SQL Server authentication and it is proving counter
> intuitive to me.
> Thanks,
> Andrew
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
>
|||That is exactly right. The ASP.NET runs at a lower privilege level.
I followed your steps and the new user, with restricted rights, is accessing
the database fine.
Now, if only I could find out how the ASP.NET user's rights could be
upgraded so that I can use integrated security.
Many thanks for your help!
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:e9I6izv6FHA.2600@.tk2msftngp13.phx.gbl...
> re:
> That explains a lot.
> The "sa" user has read/write permissions to *all* SQL Server's databases.
> Your problem is *not* the login, but that the user your connection is
> trying
> to *login as* doesn't have permissions to the objects for the database
> you're
> trying to use.
> Add the login you want to use to SQL Server and then add that user to your
> database's users, and then assign permissions for that database's objects
> to
> your new user.
> This is an object-by-object assignment.
> Make sure that all the relevant permissions to all needed objects are
> assigned.
> Then, you should have no problem with that new user accessing your db.
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
>

ASPNET User

My application attempts to connect to an SQL Server database as name ASPNET
and Login Name SERVERNAME/ASPNET in response to these commands:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;Integrated Security=SSPI");
myConnection.Open();
However, the user of this database is ASPNET. I can't create a user ASPNET
with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the
name ASPNET but eliminates the login name. How do I create the correct user
so that my application can log in?
Many thanks.re:
> I can't create a user ASPNET with a login name SERVERNAME/ASPNET
You should be able to.
Are you sure that's not SERVERNAME\ASPNET ?
Notice the difference in the slash's direction.
Other than that, which is probably a typo, you could change
the SQL Server's security to "SQL Server and Windows",
instead of "Windows", create a SQL Server login for your database,
and assign it the permissions you want it to have.
You'd have to change the connection string to use either
the loginname/password you created, or a Trusted Connection.
You'll find this to be helpful :
http://support.microsoft.com/default.aspx?kbid=316989
If the SQL Server is in a different machine that the web server, make sure y
ou read this:
http://weblogs.asp.net/AChang/archi.../15/113866.aspx
(In fact, read that even if your SQL Server is in the same machine as your w
eb server)
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
> My application attempts to connect to an SQL Server database as name ASPNE
T and Login
> Name SERVERNAME/ASPNET in response to these commands:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initia
l
> Catalog=MCSCRE;Integrated Security=SSPI");
> myConnection.Open();
> However, the user of this database is ASPNET. I can't create a user ASPNET
with a login
> name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name ASPNE
T but
> eliminates the login name. How do I create the correct user so that my app
lication can
> log in?
> Many thanks.
>
>|||You are right that the '/' is a typo. The basic problem is exactly the one
discussed in the Q316989 that you reference below. Following that article I
changed SQL Server's security to "SQL Server and Windows". I created a new
user of my database and modified my application connection string as
follows:
SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial
Catalog=MCSCRE;User ID=Logger;password=admin");
It still fails with the same error. Even the three line test program in
Q316989 fails in the same way. It is as though I need a user for SQL Server,
and then a second one for the database.
Any idea what is going on here?
Many thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
> re:
> You should be able to.
> Are you sure that's not SERVERNAME\ASPNET ?
> Notice the difference in the slash's direction.
> Other than that, which is probably a typo, you could change
> the SQL Server's security to "SQL Server and Windows",
> instead of "Windows", create a SQL Server login for your database,
> and assign it the permissions you want it to have.
> You'd have to change the connection string to use either
> the loginname/password you created, or a Trusted Connection.
> You'll find this to be helpful :
> http://support.microsoft.com/default.aspx?kbid=316989
> If the SQL Server is in a different machine that the web server, make sure
> you read this:
> http://weblogs.asp.net/AChang/archi.../15/113866.aspx
> (In fact, read that even if your SQL Server is in the same machine as your
> web server)
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:e0JBuOp6FHA.2608@.tk2msftngp13.phx.gbl...
>|||re:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);
> Initial Catalog=MCSCRE;User ID=Logger;password=admin");
I've had problems connecting when I use (local) for the SQL Server's name.
Check and see what the real name of your SQL Server instance is,
and use *that* name in your connection.
To check the instance name of your SQL Server, double-click the
SQL Server Service Manager icon in your taskbar, or open the
"Service Manager" app in the "Start Menu", "Programs",
"Microsoft SQL Server" start menu menu group.
The "Server" textbox will tell you the real name for your SQL Server instanc
e.
Try using *that name* in your connection string, instead of (local).
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
> You are right that the '/' is a typo. The basic problem is exactly the one
discussed in
> the Q316989 that you reference below. Following that article I changed SQL
Server's
> security to "SQL Server and Windows". I created a new user of my database
and modified
> my application connection string as follows:
> SqlConnection myConnection = new SqlConnection("Data Source=(local);Initia
l
> Catalog=MCSCRE;User ID=Logger;password=admin");
> It still fails with the same error. Even the three line test program in Q3
16989 fails in
> the same way. It is as though I need a user for SQL Server, and then a sec
ond one for
> the database.
> Any idea what is going on here?
> Many thanks,
> Andrew
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23Mp1p0q6FHA.2364@.TK2MSFTNGP12.phx.gbl...
>|||The latest saga..
Instead of a new user for my database and loging in as him I logged in as
'sa' (the deafult SQL user) from my app. That works!
Is it the case that my ap. was failing to log in to SQL server, rather than
inot my database? Obviously, I am new to SQL Server authentication and it is
proving counter intuitive to me.
Thanks,
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
> re:
> I've had problems connecting when I use (local) for the SQL Server's name.
> Check and see what the real name of your SQL Server instance is,
> and use *that* name in your connection.
> To check the instance name of your SQL Server, double-click the
> SQL Server Service Manager icon in your taskbar, or open the
> "Service Manager" app in the "Start Menu", "Programs",
> "Microsoft SQL Server" start menu menu group.
> The "Server" textbox will tell you the real name for your SQL Server
> instance.
> Try using *that name* in your connection string, instead of (local).
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:%23pmINWv6FHA.2524@.TK2MSFTNGP10.phx.gbl...
>|||re:
> Instead of a new user for my database and loging in as him I logged in as
'sa' (the
> default SQL user) from my app. That works!
That explains a lot.
The "sa" user has read/write permissions to *all* SQL Server's databases.
Your problem is *not* the login, but that the user your connection is trying
to *login as* doesn't have permissions to the objects for the database you'r
e
trying to use.
Add the login you want to use to SQL Server and then add that user to your
database's users, and then assign permissions for that database's objects to
your new user.
This is an object-by-object assignment.
Make sure that all the relevant permissions to all needed objects are assign
ed.
Then, you should have no problem with that new user accessing your db.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
> The latest saga..
> Instead of a new user for my database and loging in as him I logged in as
'sa' (the
> deafult SQL user) from my app. That works!
> Is it the case that my ap. was failing to log in to SQL server, rather tha
n inot my
> database? Obviously, I am new to SQL Server authentication and it is provi
ng counter
> intuitive to me.
> Thanks,
> Andrew
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:ebqeMev6FHA.476@.TK2MSFTNGP15.phx.gbl...
>|||That is exactly right. The ASP.NET runs at a lower privilege level.
I followed your steps and the new user, with restricted rights, is accessing
the database fine.
Now, if only I could find out how the ASP.NET user's rights could be
upgraded so that I can use integrated security.
Many thanks for your help!
Andrew
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:e9I6izv6FHA.2600@.tk2msftngp13.phx.gbl...
> re:
> That explains a lot.
> The "sa" user has read/write permissions to *all* SQL Server's databases.
> Your problem is *not* the login, but that the user your connection is
> trying
> to *login as* doesn't have permissions to the objects for the database
> you're
> trying to use.
> Add the login you want to use to SQL Server and then add that user to your
> database's users, and then assign permissions for that database's objects
> to
> your new user.
> This is an object-by-object assignment.
> Make sure that all the relevant permissions to all needed objects are
> assigned.
> Then, you should have no problem with that new user accessing your db.
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espaol : http://asp.net.do/foros/
> ======================================
> "Andrew Chalk" <achalk@.magnacartasoftware.com> wrote in message
> news:OGEi5rv6FHA.3876@.TK2MSFTNGP09.phx.gbl...
>

Sunday, February 19, 2012

ASPNET Acct in SQL Server 2000

I have windows Server 2003 w/ IIS 6.0 running an asp.net
web application. The web application needs to connect to
another server, with SQL Server 2000 installed. We also
have Active Directory.
My question is how do I get the ASPNET account to show up
in the list of users on SQL Server? Do I need to add it
to Active directory? Do I need to create another user as
ASPNET on SQL Server?
Thanks for the help.
Steve M.815154 HOW TO: Configure SQL Server Security for .NET Applications
http://support.microsoft.com/?id=815154
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

ASPNET account can't connect to MSSQLSERVER

When I try to access my PasswordRecovery.aspx page I get an error. I've also added the Event Warning and the Failure Audit. I've tried deleting the ASPNET user account and recreating it using aspnet_regiis.exe. I still get the same error message. Should I add the ASPNET account to the Administrators group? Currently it is with the Users group.

Login failed for user 'PC325862970629\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 'PC325862970629\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): Login failed for user 'PC325862970629\ASPNET'.]

System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734979

System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188

System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838

System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33

System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628

System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170

System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359

System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28

System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424

System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66

System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496

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.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121

System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105

System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42

System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83

System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160

System.Web.UI.WebControls.Login.AttemptLogin() +105

System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35

System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115

System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7

System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11

System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

When I check my Events log I see this warning:

-

Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 8/24/2006
Time: 5:13:54 PM
User: N/A
Computer: PC325862970629
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 8/24/2006 5:13:54 PM
Event time (UTC): 8/25/2006 12:13:54 AM
Event ID: b3b1e4fbbd634d04a5acd3de09a4df88
Event sequence: 22
Event occurrence: 7
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/Root/Aidms-1-128009374139687500
Trust level: Full
Application Virtual Path: /Aidms
Application Path: C:\aidms\
Machine name: PC325862970629
Process information:
Process ID: 5128
Process name: aspnet_wp.exe
Account name: PC325862970629\ASPNET
Exception information:
Exception type: SqlException
Exception message: Login failed for user 'PC325862970629\ASPNET'.
Request information:
Request URL: http://localhost/Aidms/Default.aspx
Request path: /Aidms/Default.aspx
User host address: 127.0.0.1
User:
Is authenticated: False
Authentication Type:
Thread account name: PC325862970629\ASPNET
Thread information:
Thread ID: 1
Thread account name: PC325862970629\ASPNET
Is impersonating: False
Stack trace: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate)
at System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation)
at System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate)
at System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat)
at System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved)
at System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password)
at System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e)
at System.Web.UI.WebControls.Login.AttemptLogin()
at System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

And then I see this Failutre Audit

--

Event Type: Failure Audit
Event Source: MSSQLSERVER
Event Category: (4)
Event ID: 18456
Date: 8/24/2006
Time: 5:13:54 PM
User: PC325862970629\ASPNET
Computer: PC325862970629
Description:
Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 18 48 00 00 0e 00 00 00 .H......
0008: 0f 00 00 00 50 00 43 00 ....P.C.
0010: 33 00 32 00 35 00 38 00 3.2.5.8.
0018: 36 00 32 00 39 00 37 00 6.2.9.7.
0020: 30 00 36 00 32 00 39 00 0.6.2.9.
0028: 00 00 07 00 00 00 6d 00 ......m.
0030: 61 00 73 00 74 00 65 00 a.s.t.e.
0038: 72 00 00 00 r...

The security folks may be able to answer this more quickly.

Thanks,
Sam

|||Is your ASP.NET app and SQL Server both in the same machine?|||Yes both ASP and SQLSERVRER are running on the same machine.|||

Can you have a look at the errorlog file of SQL Server and copy the error logged there? It should be under the LOG directory of your installation. A new log is created after each restart, so you may have to look at several files to find the one that contains this error.

Also, have you allowed the ASPNET account to access your SQL Server installation? Did this connection ever work or is it the first time you tried it?

Thanks
Laurentiu

|||I didn't have to allow the ASNET account access to my SQL Server installation before because it was working fine. Can you please give me the instructions to allow access to my SQL server?

Below is the log file from SQL server that I believe ties in to the above problem.
-
2006-08-24 16:55:27.06 Server Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

2006-08-24 16:55:27.06 Server (c) 2005 Microsoft Corporation.
2006-08-24 16:55:27.06 Server All rights reserved.
2006-08-24 16:55:27.06 Server Server process ID is 2636.
2006-08-24 16:55:27.06 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2006-08-24 16:55:27.06 Server This instance of SQL Server last reported using a process ID of 476 at 8/24/2006 4:53:33 PM (local) 8/24/2006 11:53:33 PM (UTC). This is an informational message only; no user action is required.
2006-08-24 16:55:28.46 Server Registry startup parameters:
2006-08-24 16:55:28.54 Server -d C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2006-08-24 16:55:28.54 Server -e C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2006-08-24 16:55:28.54 Server -l C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
2006-08-24 16:55:29.46 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2006-08-24 16:55:29.46 Server Detected 1 CPUs. This is an informational message; no user action is required.
2006-08-24 16:55:33.07 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2006-08-24 16:55:35.20 Server Attempting to initialize Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.
2006-08-24 16:55:37.06 Server The Microsoft Distributed Transaction Coordinator (MS DTC) service could not be contacted. If you would like distributed transaction functionality, please start this service.
2006-08-24 16:55:37.15 Server Database Mirroring Transport is disabled in the endpoint configuration.
2006-08-24 16:55:37.37 spid5s Starting up database 'master'.
2006-08-24 16:55:37.82 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2006-08-24 16:55:38.37 spid5s SQL Trace ID 1 was started by login "sa".
2006-08-24 16:55:38.46 spid5s Starting up database 'mssqlsystemresource'.
2006-08-24 16:55:38.92 spid9s Starting up database 'model'.
2006-08-24 16:55:38.93 spid5s Server name is 'PC325862970629'. This is an informational message only. No user action is required.
2006-08-24 16:55:39.26 Server A self-generated certificate was successfully loaded for encryption.
2006-08-24 16:55:39.28 Server Server is listening on [ 'any' <ipv4> 1433].
2006-08-24 16:55:39.28 Server Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
2006-08-24 16:55:39.28 Server Server named pipe provider is ready to accept connection on [ \\.\pipe\sql\query ].
2006-08-24 16:55:39.28 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
2006-08-24 16:55:39.28 Server Dedicated admin connection support was established for listening locally on port 1434.
2006-08-24 16:55:39.32 Server The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
2006-08-24 16:55:39.34 Server SQL Server is now ready for client connections. This is an informational message; no user action is required.
2006-08-24 16:55:39.87 spid9s Clearing tempdb database.
2006-08-24 16:55:41.20 spid9s Starting up database 'tempdb'.
2006-08-24 16:55:42.79 spid12s The Service Broker protocol transport is disabled or not configured.
2006-08-24 16:55:42.79 spid12s The Database Mirroring protocol transport is disabled or not configured.
2006-08-24 16:55:42.92 spid12s Service Broker manager has started.
2006-08-24 16:55:45.23 spid14s Starting up database 'msdb'.
2006-08-24 16:55:45.23 spid16s Starting up database 'Aidms'.
2006-08-24 16:55:48.67 spid5s Recovery is complete. This is an informational message only. No user action is required.
2006-08-24 16:57:16.43 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 16:57:16.43 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 16:57:31.57 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 16:57:31.57 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 16:58:41.96 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 16:58:41.96 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 17:06:49.76 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 17:06:49.76 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 17:09:40.25 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 17:09:40.25 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 17:13:54.57 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 17:13:54.57 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 17:23:59.60 Logon Error: 18456, Severity: 14, State: 11.
2006-08-24 17:23:59.60 Logon Login failed for user 'PC325862970629\ASPNET'. [CLIENT: <local machine>]
2006-08-24 17:36:26.00 Server SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.
2006-08-24 17:36:28.03 spid12s Service Broker manager has shut down.
2006-08-24 17:36:28.04 spid12s Error: 17054, Severity: 16, State: 1.
2006-08-24 17:36:28.04 spid12s The current event was not reported to the Windows Events log. Operating system error = 31(A device attached to the system is not functioning.). You may need to clear the Windows Events log if it is full.
2006-08-24 17:36:31.17 spid5s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
2006-08-24 17:36:33.01 Server The SQL Network Interface library could not deregister the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b. Administrator should deregister this SPN manually to avoid client authentication errors.|||

You can execute:

CREATE LOGIN [PC325862970629\ASPNET] FROM WINDOWS

to create a SQL login for the ASPNET account. Let us know if this doesn't solve the login failure. I am not sure about the additional permissions that you need to grant to the ASPNET account for your application to work. A better forum for such further inquiries would be the ASP.Net forum at: http://forums.asp.net/default.aspx.

Thanks
Laurentiu

|||Aspnet_regiis.exe creates the ASPNET account for windows. I've deleted and recreated the account twice but I still get the same above error. Any help from a Microsoft representative would help in addition to the suggestions that have been given to far.|||

The command I mentioned in my previous post needs to be executed within SQL Server. You need to connect to SQL Server using a tool like sqlcmd or Management Studio, and issue that command to allow the ASPNET account to connect to SQL Server.

Thanks
Laurentiu

|||Thank you very much. Your previous post was te solution to my problem.

Asp+sql sercer

I have sql server express at my PC-windows xp professional, I try to connect to a table via asp (queryString :"Driver={SQL Server};" &"Server=localhost;" & _
"Database=local;" & "Uid=dimis;" & "Pwd=network;" but there is an error
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][DBNETLIB]"The SQL server does not exist or there is no permission.
I can login with EMS lite both with sql server Auth. and windows auth.
What is fault?
DimisI try this: Provider=SQLOLEDB;Persist Security Info=False;User ID=nikos;pwd=nikos;Initial Catalog=LOCAL;Data Source=localhost\SQLEXPRESS;Connect Timeout=120"|||Refer KBA http://support.microsoft.com/kb/328306/en-us to resolve the issue.

Thursday, February 16, 2012

ASP.Net SQL Provider

Hello,
I am using the Visual Web Developer and would like to use the Web Site
Administration Tool to connect to a remote SQL server (it defaults to SQL
Express).
I have already run the regsql tool. My tables on my remote SQL server are
installed.
How do I add a provider in the code since I cannot do it in the GUI?
Thank you,
Exchange2003See if this helps you
www.ConnectionStrings.com
Madhivanan

Sunday, February 12, 2012

ASP.NET database won't connect...

I setup a asp.net project running on http://localhost/ which connects to a
database on another server running sqlserver...
I was able to connect to the database and create my application no problem.
The sqlserver database server had windows 2000 without any SP's or updates.
This was no problem and even though the OS hadn't the .net framework
installed, everything worked fine.
the requirements for that sqlserver database server have since changed, and
windows update was visited to get all the updates, including the latest SP's
as well as the .net framework. I also installed the remote only debugging
for VS.net on this server so that I'm also able to use this as a IIS
server...
Anyway, back to my problem, since these updates the asp.net application i
run from my machine, whcih connects to this database server, has stopped
working with error "SQL Server does not exist or access denied" on the line
where the .Open() is called on the ADO.net database connection object.
Any ideas?It sounds like one of the updates tightened the security on your SQL database.
You'll want to verify that the account you are using for the data still has
sufficient rights.
Is it possible that the sa account or its password was changed?
"Daniel Bass" <danielbassNOJUNK@.MAILpostmaster.co.uk> wrote in message
news:eO9GBgBXDHA.2200@.TK2MSFTNGP09.phx.gbl...
I setup a asp.net project running on http://localhost/ which connects to a
database on another server running sqlserver...
I was able to connect to the database and create my application no problem.
The sqlserver database server had windows 2000 without any SP's or updates.
This was no problem and even though the OS hadn't the .net framework
installed, everything worked fine.
the requirements for that sqlserver database server have since changed, and
windows update was visited to get all the updates, including the latest SP's
as well as the .net framework. I also installed the remote only debugging
for VS.net on this server so that I'm also able to use this as a IIS
server...
Anyway, back to my problem, since these updates the asp.net application i
run from my machine, whcih connects to this database server, has stopped
working with error "SQL Server does not exist or access denied" on the line
where the .Open() is called on the ADO.net database connection object.
Any ideas?|||The strange thing is that when i connect to it via the server explorer it
still works, and I'm able to view tables, edit data etc etc...
If i delete my connection, recreate it and rename it, I get the same result.
If I connect to the database via classic ASP, it works fine...
I've checked the sa login but appears it's still okay.
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:ODWGphBXDHA.652@.TK2MSFTNGP10.phx.gbl...
> It sounds like one of the updates tightened the security on your SQL
database.
> You'll want to verify that the account you are using for the data still
has
> sufficient rights.
> Is it possible that the sa account or its password was changed?
> "Daniel Bass" <danielbassNOJUNK@.MAILpostmaster.co.uk> wrote in message
> news:eO9GBgBXDHA.2200@.TK2MSFTNGP09.phx.gbl...
> I setup a asp.net project running on http://localhost/ which connects to a
> database on another server running sqlserver...
> I was able to connect to the database and create my application no
problem.
> The sqlserver database server had windows 2000 without any SP's or
updates.
> This was no problem and even though the OS hadn't the .net framework
> installed, everything worked fine.
> the requirements for that sqlserver database server have since changed,
and
> windows update was visited to get all the updates, including the latest
SP's
> as well as the .net framework. I also installed the remote only debugging
> for VS.net on this server so that I'm also able to use this as a IIS
> server...
> Anyway, back to my problem, since these updates the asp.net application i
> run from my machine, whcih connects to this database server, has stopped
> working with error "SQL Server does not exist or access denied" on the
line
> where the .Open() is called on the ADO.net database connection object.
> Any ideas?
>
>|||Daniel,
What does your connection string look like?
Benny Tordrup
"Daniel Bass" <danielbassNOJUNK@.MAILpostmaster.co.uk> skrev i en meddelelse
news:eO9GBgBXDHA.2200@.TK2MSFTNGP09.phx.gbl...
> I setup a asp.net project running on http://localhost/ which connects to a
> database on another server running sqlserver...
> I was able to connect to the database and create my application no
problem.
> The sqlserver database server had windows 2000 without any SP's or
updates.
> This was no problem and even though the OS hadn't the .net framework
> installed, everything worked fine.
> the requirements for that sqlserver database server have since changed,
and
> windows update was visited to get all the updates, including the latest
SP's
> as well as the .net framework. I also installed the remote only debugging
> for VS.net on this server so that I'm also able to use this as a IIS
> server...
> Anyway, back to my problem, since these updates the asp.net application i
> run from my machine, whcih connects to this database server, has stopped
> working with error "SQL Server does not exist or access denied" on the
line
> where the .Open() is called on the ADO.net database connection object.
> Any ideas?
>|||Does this mean i have to set up an "asp.net" account?
I've not seen any place to do this, how is it done?
thanks.
Dan
"Kevin Spencer" <kevin@.takempis.com> wrote in message
news:%23vq9tMCXDHA.2484@.TK2MSFTNGP09.phx.gbl...
> Your server explorer runs under a different account than ASP.Net.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> http://www.takempis.com
> Complex things are made up of
> lots of simple things.
> "Daniel Bass" <danielbassNOJUNK@.MAILpostmaster.co.uk> wrote in message
> news:u6frlmBXDHA.3444@.tk2msftngp13.phx.gbl...
> > The strange thing is that when i connect to it via the server explorer
it
> > still works, and I'm able to view tables, edit data etc etc...
> >
> > If i delete my connection, recreate it and rename it, I get the same
> result.
> > If I connect to the database via classic ASP, it works fine...
> >
> > I've checked the sa login but appears it's still okay.
> >
> >
> >
> > "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
> > news:ODWGphBXDHA.652@.TK2MSFTNGP10.phx.gbl...
> > > It sounds like one of the updates tightened the security on your SQL
> > database.
> > > You'll want to verify that the account you are using for the data
still
> > has
> > > sufficient rights.
> > >
> > > Is it possible that the sa account or its password was changed?
> > >
> > > "Daniel Bass" <danielbassNOJUNK@.MAILpostmaster.co.uk> wrote in message
> > > news:eO9GBgBXDHA.2200@.TK2MSFTNGP09.phx.gbl...
> > > I setup a asp.net project running on http://localhost/ which connects
to
> a
> > > database on another server running sqlserver...
> > >
> > > I was able to connect to the database and create my application no
> > problem.
> > >
> > > The sqlserver database server had windows 2000 without any SP's or
> > updates.
> > > This was no problem and even though the OS hadn't the .net framework
> > > installed, everything worked fine.
> > >
> > > the requirements for that sqlserver database server have since
changed,
> > and
> > > windows update was visited to get all the updates, including the
latest
> > SP's
> > > as well as the .net framework. I also installed the remote only
> debugging
> > > for VS.net on this server so that I'm also able to use this as a IIS
> > > server...
> > >
> > > Anyway, back to my problem, since these updates the asp.net
application
> i
> > > run from my machine, whcih connects to this database server, has
stopped
> > > working with error "SQL Server does not exist or access denied" on the
> > line
> > > where the .Open() is called on the ADO.net database connection object.
> > >
> > > Any ideas?
> > >
> > >
> > >
> >
> >
>|||Daniel,
Apply the following commands in Query Analyzer (replace <ComputerName> with
the name of the SQL Server Computer and <DatabaseName> with the name of the
database that ASP.NET needs access to:
<SQL>
Exec sp_grantlogin '<ComputerName>\ASPNET'
go
use [<DatabaseName>]
go
EXEC sp_grantdbaccess '<ComputerName>\ASPNET'
go
exec sp_addrolemember @.rolename='db_owner', @.membername='<ComputerName>\ASPNET'
go
</SQL>
Best regards,
Benny Tordrup
"Daniel Bass" <danielbassNOJUNK@.MAILpostmaster.co.uk> skrev i en meddelelse
news:uIQz4oCXDHA.2444@.tk2msftngp13.phx.gbl...
> Does this mean i have to set up an "asp.net" account?
> I've not seen any place to do this, how is it done?
> thanks.
> Dan
>
> "Kevin Spencer" <kevin@.takempis.com> wrote in message
> news:%23vq9tMCXDHA.2484@.TK2MSFTNGP09.phx.gbl...
> > Your server explorer runs under a different account than ASP.Net.
> >
> > --
> > HTH,
> >
> > Kevin Spencer
> > Microsoft MVP
> > .Net Developer
> > http://www.takempis.com
> > Complex things are made up of
> > lots of simple things.
> >
> > "Daniel Bass" <danielbassNOJUNK@.MAILpostmaster.co.uk> wrote in message
> > news:u6frlmBXDHA.3444@.tk2msftngp13.phx.gbl...
> > > The strange thing is that when i connect to it via the server explorer
> it
> > > still works, and I'm able to view tables, edit data etc etc...
> > >
> > > If i delete my connection, recreate it and rename it, I get the same
> > result.
> > > If I connect to the database via classic ASP, it works fine...
> > >
> > > I've checked the sa login but appears it's still okay.
> > >
> > >
> > >
> > > "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in
message
> > > news:ODWGphBXDHA.652@.TK2MSFTNGP10.phx.gbl...
> > > > It sounds like one of the updates tightened the security on your SQL
> > > database.
> > > > You'll want to verify that the account you are using for the data
> still
> > > has
> > > > sufficient rights.
> > > >
> > > > Is it possible that the sa account or its password was changed?
> > > >
> > > > "Daniel Bass" <danielbassNOJUNK@.MAILpostmaster.co.uk> wrote in
message
> > > > news:eO9GBgBXDHA.2200@.TK2MSFTNGP09.phx.gbl...
> > > > I setup a asp.net project running on http://localhost/ which
connects
> to
> > a
> > > > database on another server running sqlserver...
> > > >
> > > > I was able to connect to the database and create my application no
> > > problem.
> > > >
> > > > The sqlserver database server had windows 2000 without any SP's or
> > > updates.
> > > > This was no problem and even though the OS hadn't the .net framework
> > > > installed, everything worked fine.
> > > >
> > > > the requirements for that sqlserver database server have since
> changed,
> > > and
> > > > windows update was visited to get all the updates, including the
> latest
> > > SP's
> > > > as well as the .net framework. I also installed the remote only
> > debugging
> > > > for VS.net on this server so that I'm also able to use this as a IIS
> > > > server...
> > > >
> > > > Anyway, back to my problem, since these updates the asp.net
> application
> > i
> > > > run from my machine, whcih connects to this database server, has
> stopped
> > > > working with error "SQL Server does not exist or access denied" on
the
> > > line
> > > > where the .Open() is called on the ADO.net database connection
object.
> > > >
> > > > Any ideas?
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>

ASP.NET connection string problems with SQL Server 2000

My aspx page is trying to connect to a remote server with SQL Server 2000 installed on it, the ip of the server is 172.16.3.111 and the same is the instance of SQL Server, sql server is running in SQL Server Authentication mode, user id is "test" and password is "test123", name of database is myDB,the connection string which I am providing is as follows:

data source=172.16.3.111\172.16.3.111;user id=test;password=test123;initial catalog=myDB;"

But I am getting the following exception:

SQL Server does not exist or access denied.

even if I try the following connection string:
"data source=172.16.3.111;user id=test;password=test123;initial catalog=myDB;"

than also I get the same exception

even if provide the following connection strings:

"SERVER=172.16.3.111;UID=test;PWD=test123;DATABASE =myDB;"

"SERVER=172.16.3.111\172.16.3.111;UID=test;PWD=test123;DATABASE =myDB;"

than also I get the same exceptions

Can u please tell whats the problem,is the connection string correct,the DBA has also registered me "test" as a user on the SQL server.One thing which I want to mention is that through enterprise manager I can connect and use sql server without any problems,also please note that in VS.NET when I try connecting using server explorer and test the connection than I connect successfully, than why is problem occuring in connecting throug aspx page.

Try change the param "Server" like this:

\\ server name or server ip \ instance name

asp.net connect to sql server

i need code for this guys... no one has given any straight answers... paypal $200/hr for consulting fees. Otherwise, you're going to have to read a book.|||Take a look @.this article
Does this help?

asp.net cannot connect to sql 2000

i have do a web site with asp.net 2.0

when i run the on the development pc it can coonect to db

when i publish the website, it become cannot connect to sql2000

the conn string as below
strConn = "Data Source=SHHDB;Initial Catalog=test8;Persist Security Info=True;User ID=sa;Password=;Trusted_Connection=yes;Current Language=British;"

the DB server is on other pc with same network

and i have public it to same pc with the development pc

it come out with "erro like cannot connect to sqlserver 2005, name pipe error: 40"

the problem is the both iis and dbpc don have sql 2005

only db server installed sql 2000

Hi,

From your question, it seems your application is attemp to use the LocalSqlServer connectionstring which needs a attached Sql Express database, so please don't use the LocalSqlServer and open your Web.Config file and in the ConnectionString node, modify your connection string and make it look like "Data Source=ServerName\InstanceName(or IP address);Initial Catelog=DatabaseName; User id=;Password=". Meantime, as your DB server is on other pc with same network, so please use some tools such as QA to verify if the remote database server can be accessible first.

Thanks.

|||

Sorry duplicate post

|||

Hi,

do you've admin rights to database server? if yes then by yourself or else ask your admin to enable remote connection on the database server. may be following link will help you

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_22604523.html

thanks,

satish.

ASP.NET and SQL Server

Hello.
I have an asp.net application which currently connects to a local instance
of sql server without any issue.
When I connect to a remote sql server (same database and userid and password
are valid) there is an error indicating 'access denied.' But, when the same
code and connection strings are run on the remote server (along with the
database) the application works fine.
Connection String
user id=UserName;password=password,data source=datasource;initial
catalog=dbName
datasource\ASPNET has been added to the sql server as a user.
Any ideas? I'm using SQL Authentication and ASP.NET 1.1
Does ASP.NET run under another account when accessing a remote server?
Thanks.a) look up SetSpn
b) look up 'trust for delegation'
I bitched up a storm about this at microsoft; they don't publish this
information anywhere.
it pissed me off sooooo bad.
it's like some secret squirrel functionality in Active Directory.
-Aaron
mojo wrote:
> Hello.
> I have an asp.net application which currently connects to a local instance
> of sql server without any issue.
> When I connect to a remote sql server (same database and userid and passwo
rd
> are valid) there is an error indicating 'access denied.' But, when the sam
e
> code and connection strings are run on the remote server (along with the
> database) the application works fine.
> Connection String
> user id=UserName;password=password,data source=datasource;initial
> catalog=dbName
> datasource\ASPNET has been added to the sql server as a user.
> Any ideas? I'm using SQL Authentication and ASP.NET 1.1
> Does ASP.NET run under another account when accessing a remote server?
> Thanks.|||Since you use Username/Password pair (meaning the SQL Server's
authentication mode is mixed mode), it does not matter if you add
MachineName\ASPNET user account as a login/user to the SQL Server/database.
The other posted reply also make no sense to your problem.
Which version of QL Server do you use? SQL Server2000 or 2005? I'd look into
two things:
1. Is remote access to the SQL Server enabled? by default installation
(especially if it is SQL Server2005/Express), remote access is disabled. You
nned to explicitly enable remote access to it;
2. Double-check to make sure the SQL Server's authentication mode is mixed
mode. Again. by default installation, SQL Server uses Windows Authentication
mode (If your app indeed worked on the same computer as the SQL Server, with
the given user name and password in connectionString, then you do not need
make this check, unless the remote SQL Server is not the same SQL Server you
have tested on the same computer).
"mojo" <mojo@.discussions.microsoft.com> wrote in message
news:52A09F8F-BC9B-4DFE-B004-3D406F0B5760@.microsoft.com...
> Hello.
> I have an asp.net application which currently connects to a local instance
> of sql server without any issue.
> When I connect to a remote sql server (same database and userid and
> password
> are valid) there is an error indicating 'access denied.' But, when the
> same
> code and connection strings are run on the remote server (along with the
> database) the application works fine.
> Connection String
> user id=UserName;password=password,data source=datasource;initial
> catalog=dbName
> datasource\ASPNET has been added to the sql server as a user.
> Any ideas? I'm using SQL Authentication and ASP.NET 1.1
> Does ASP.NET run under another account when accessing a remote server?
> Thanks.
>|||Hello,
Yes, I did double check that and it is in mixed mode. I'm running SQL Server
2000 on Windows XP & ASP.NET 1.1.
Regarding remote access, where is that in SQL 2000? I don't believe I've ran
into that setting before. Do you mind pointing me in the direction of where
I
can find it?
Thanks
"Norman Yuan" wrote:

> Since you use Username/Password pair (meaning the SQL Server's
> authentication mode is mixed mode), it does not matter if you add
> MachineName\ASPNET user account as a login/user to the SQL Server/database
.
> The other posted reply also make no sense to your problem.
> Which version of QL Server do you use? SQL Server2000 or 2005? I'd look in
to
> two things:
> 1. Is remote access to the SQL Server enabled? by default installation
> (especially if it is SQL Server2005/Express), remote access is disabled. Y
ou
> nned to explicitly enable remote access to it;
> 2. Double-check to make sure the SQL Server's authentication mode is mixed
> mode. Again. by default installation, SQL Server uses Windows Authenticati
on
> mode (If your app indeed worked on the same computer as the SQL Server, wi
th
> the given user name and password in connectionString, then you do not need
> make this check, unless the remote SQL Server is not the same SQL Server y
ou
> have tested on the same computer).
> "mojo" <mojo@.discussions.microsoft.com> wrote in message
> news:52A09F8F-BC9B-4DFE-B004-3D406F0B5760@.microsoft.com...
>
>|||check
sp_configure sysytem stored procedure.
I think it might require a restart for the changes to take effect.
-Omnibuzz (The SQL GC)
http://omnibuzz-sql.blogspot.com/|||ok, I checked Remote Access and it was already set to true.
Any ideas if this issue is related to version of install (Personal v
Standard v Enterprise Edition)?
"Omnibuzz" wrote:

> check
> sp_configure sysytem stored procedure.
> I think it might require a restart for the changes to take effect.
> -Omnibuzz (The SQL GC)
> http://omnibuzz-sql.blogspot.com/
>|||Can you connect to the said SQL Server from other computers at all (you can
try to access the SQL Server from other computer by creating ODBC data
source on these computers, or create a data link file (blank text file with
extension *.udl).
If you can, then it is the problem of your ASP.NET app (assume the network
cable/hub... hardware are OK. Have you checked them?), if you cannot, it is
the problem of the SQL Server configuration.
"mojo" <mojo@.discussions.microsoft.com> wrote in message
news:D4B879EE-7CBE-4A7F-B0AD-C10DDE16685D@.microsoft.com...
> Hello,
> Yes, I did double check that and it is in mixed mode. I'm running SQL
> Server
> 2000 on Windows XP & ASP.NET 1.1.
> Regarding remote access, where is that in SQL 2000? I don't believe I've
> ran
> into that setting before. Do you mind pointing me in the direction of
> where I
> can find it?
> Thanks
> "Norman Yuan" wrote:
>