Showing posts with label serious. Show all posts
Showing posts with label serious. Show all posts

Sunday, March 11, 2012

Connection to SQL server Help SOS

I have SQL Server2000 installed on my PC when I am trying to do some programs in ASP.NET application. I have serious problem working with the SQL server 2000.Whenever I use visual tools to connect to the server or manually. Explorer returns error
//////////////////////////////////////////////////////////////////////////////////////////////
Server Error in '/ASP.NetPage530' Application.

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

Source Error:

Line 88: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 89: If Not IsPostBack Then
Line 90: SqlDataAdapter1.Fill(DsCustID1, "Customers")
Line 91: DataBind()
Line 92: End If

Source File: C:\Inetpub\wwwroot\ASP.NetPage530\WebForm1.aspx.vb Line: 90

Stack Trace:

[SqlException: Login failed for user 'ZEUS\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, String srcTable)
ASP.NetPage530.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\ASP.NetPage530\WebForm1.aspx.vb:90
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
////////////////////////////////////////////////////////////////////////////////////////////////////////
No errors exist when I work with windows application both in ACCESS or SQL SERVER Databases and no errors exists when I am using access files in asp.net applicationand in both cases i use Windows NT Integrated Security .Most probably I need to configure my IIS5.0 but how I have no idea
Can anyone help?You may need to grant 'ZEUS\ASPNET' login permissions to your SQL Server. You can do this directly in SQL Server Enterprise Manager if you have it. Otherwise, you will need to use SQL language by running osql.exe from the command line.|||Yes but in command promt it asks for a password I have only one one pasword is system password which is invalid in command promt for osql.exe how i can configure it ?please help|||Type osql /? at the command line.

This gives you a list of parameters you can use to run the program.

I think you can use the-E parameter for a trusted connection.|||Thank you trying help me but I have no idea how to use –E parameters
I have tried the following command in command prompt osql/E the output was the number 1 what it means I don't know pushing the enter gives 2 and etc
what i have to do to enable trusted connections ???|||
If you are seeing this:

1
That means you are logged in succesfully.

Now you can execute any SQL statement. Each statement can consist of multiple lines. When you are finished, typeGO on a new line and hit enter. For Example (type enter at the end of each line):

1>Select name
2>From sysxlogins
3>go

This will display a list of current logins for your database.

What you need to do next is find some documentation on SQL language on how to add logins and grant them access to databases and database objects.

Have a look here for granting an NT user login permissions:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_ga-gz_8dri.asp

If you like, you can go here for security in general:http://msdn.microsoft.com/library/en-us/adminsql/ad_security_05bt.asp?frame=true

I hope this helps.

Sunday, February 12, 2012

Connection problems SQL Express

I have a serious SQL Express connection problem on one of our customers
machine. The errormessage reads: "User does not have permission to perform
this action".
Our application is a .Net 2.0 Windows Application. Using the
System.Data.SQLClient.SQLConnection class to connect. The user is logged on
with an account that grants Administrator priviledges on the machine.
The connectionstring looks like this:
Data Source=.\SQLExpress;AttachDbFilename=C:\Temp\Test. mdf;Integrated
Security=True;User Instance=True
Our company have distributed lots of applications where this works
perfectly, but suddenly we get this error on one machine.
When I use SQLCMD I can connect to the .\SQLExpress instance and attach the
file C:\Temp\Test.mdf and query the tables. When the database is attached as
"Test", I can even connect from a .Net Windows application to the database
using the following connectionstring:
Data Source=.\SQLExpress;Initial Catalog=Test;Integrated Security=True
So it seems like there is a problem with connecting using
"AttachDbFilename=C:\Temp\Test.mdf" or "User Instance=True"
Can anyone help me on this?
I would go with the obvious and assume the user running your application
doesn't have write permissions on the C:\Temp\Test.mdf or C:\Temp\Test.ldf
file. This would explain all of the symptoms you have described.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Allan G. P." <Allan G. P.@.discussions.microsoft.com> wrote in message
news:076BB143-01B4-4F42-853C-3C864D51DFC0@.microsoft.com...
>I have a serious SQL Express connection problem on one of our customers
> machine. The errormessage reads: "User does not have permission to perform
> this action".
> Our application is a .Net 2.0 Windows Application. Using the
> System.Data.SQLClient.SQLConnection class to connect. The user is logged
> on
> with an account that grants Administrator priviledges on the machine.
> The connectionstring looks like this:
> Data Source=.\SQLExpress;AttachDbFilename=C:\Temp\Test. mdf;Integrated
> Security=True;User Instance=True
> Our company have distributed lots of applications where this works
> perfectly, but suddenly we get this error on one machine.
> When I use SQLCMD I can connect to the .\SQLExpress instance and attach
> the
> file C:\Temp\Test.mdf and query the tables. When the database is attached
> as
> "Test", I can even connect from a .Net Windows application to the database
> using the following connectionstring:
> Data Source=.\SQLExpress;Initial Catalog=Test;Integrated Security=True
> So it seems like there is a problem with connecting using
> "AttachDbFilename=C:\Temp\Test.mdf" or "User Instance=True"
> Can anyone help me on this?
|||I'm not sure it would. The .ldf-file IS created when I use SQLCMD to attach
the mdf-file (still logged on as the same user). I don't believe that this
would be possible if the user didn't have write permission to the directory.
And as I described below - the user has local admin rights.
"Roger Wolter[MSFT]" wrote:

> I would go with the obvious and assume the user running your application
> doesn't have write permissions on the C:\Temp\Test.mdf or C:\Temp\Test.ldf
> file. This would explain all of the symptoms you have described.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Allan G. P." <Allan G. P.@.discussions.microsoft.com> wrote in message
> news:076BB143-01B4-4F42-853C-3C864D51DFC0@.microsoft.com...
>
|||When you connect with SQLCMD, sql is running as NetworkService or whatever
user you specified for the service to run as when you installed sql. When
you connect with the userinstance option set, sql is running as the user
running your program. If you already know what the problem is and isn't,
I'll stop wasting your time.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Allan G. P." <AllanGP@.discussions.microsoft.com> wrote in message
news:8AB9575C-3961-4EB7-B3E1-64FCEA7EEE52@.microsoft.com...[vbcol=seagreen]
> I'm not sure it would. The .ldf-file IS created when I use SQLCMD to
> attach
> the mdf-file (still logged on as the same user). I don't believe that this
> would be possible if the user didn't have write permission to the
> directory.
> And as I described below - the user has local admin rights.
> "Roger Wolter[MSFT]" wrote:

Connection problems SQL Express

I have a serious SQL Express connection problem on one of our customers
machine. The errormessage reads: "User does not have permission to perform
this action".
Our application is a .Net 2.0 Windows Application. Using the
System.Data.SQLClient.SQLConnection class to connect. The user is logged on
with an account that grants Administrator priviledges on the machine.
The connectionstring looks like this:
Data Source=. \SQLExpress;AttachDbFilename=C:\Temp\Tes
t.mdf;Integrated
Security=True;User Instance=True
Our company have distributed lots of applications where this works
perfectly, but suddenly we get this error on one machine.
When I use SQLCMD I can connect to the .\SQLExpress instance and attach the
file C:\Temp\Test.mdf and query the tables. When the database is attached as
"Test", I can even connect from a .Net Windows application to the database
using the following connectionstring:
Data Source=.\SQLExpress;Initial Catalog=Test;Integrated Security=True
So it seems like there is a problem with connecting using
"AttachDbFilename=C:\Temp\Test.mdf" or "User Instance=True"
Can anyone help me on this?I would go with the obvious and assume the user running your application
doesn't have write permissions on the C:\Temp\Test.mdf or C:\Temp\Test.ldf
file. This would explain all of the symptoms you have described.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Allan G. P." <Allan G. P.@.discussions.microsoft.com> wrote in message
news:076BB143-01B4-4F42-853C-3C864D51DFC0@.microsoft.com...
>I have a serious SQL Express connection problem on one of our customers
> machine. The errormessage reads: "User does not have permission to perform
> this action".
> Our application is a .Net 2.0 Windows Application. Using the
> System.Data.SQLClient.SQLConnection class to connect. The user is logged
> on
> with an account that grants Administrator priviledges on the machine.
> The connectionstring looks like this:
> Data Source=. \SQLExpress;AttachDbFilename=C:\Temp\Tes
t.mdf;Integrated
> Security=True;User Instance=True
> Our company have distributed lots of applications where this works
> perfectly, but suddenly we get this error on one machine.
> When I use SQLCMD I can connect to the .\SQLExpress instance and attach
> the
> file C:\Temp\Test.mdf and query the tables. When the database is attached
> as
> "Test", I can even connect from a .Net Windows application to the database
> using the following connectionstring:
> Data Source=.\SQLExpress;Initial Catalog=Test;Integrated Security=True
> So it seems like there is a problem with connecting using
> "AttachDbFilename=C:\Temp\Test.mdf" or "User Instance=True"
> Can anyone help me on this?|||I'm not sure it would. The .ldf-file IS created when I use SQLCMD to attach
the mdf-file (still logged on as the same user). I don't believe that this
would be possible if the user didn't have write permission to the directory.
And as I described below - the user has local admin rights.
"Roger Wolter[MSFT]" wrote:

> I would go with the obvious and assume the user running your application
> doesn't have write permissions on the C:\Temp\Test.mdf or C:\Temp\Test.ldf
> file. This would explain all of the symptoms you have described.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Allan G. P." <Allan G. P.@.discussions.microsoft.com> wrote in message
> news:076BB143-01B4-4F42-853C-3C864D51DFC0@.microsoft.com...
>|||When you connect with SQLCMD, sql is running as NetworkService or whatever
user you specified for the service to run as when you installed sql. When
you connect with the userinstance option set, sql is running as the user
running your program. If you already know what the problem is and isn't,
I'll stop wasting your time.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Allan G. P." <AllanGP@.discussions.microsoft.com> wrote in message
news:8AB9575C-3961-4EB7-B3E1-64FCEA7EEE52@.microsoft.com...[vbcol=seagreen]
> I'm not sure it would. The .ldf-file IS created when I use SQLCMD to
> attach
> the mdf-file (still logged on as the same user). I don't believe that this
> would be possible if the user didn't have write permission to the
> directory.
> And as I described below - the user has local admin rights.
> "Roger Wolter[MSFT]" wrote:
>