473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Security Errors trying to fill dataset

I am developing my first .NET application that connects to a SQL
Server 2000 database and I am having a total nightmare :x :evil:
I am running Windows 2000 with Visual Studio .NET version 7.0.9466,
.NET Framework 1.0.3705 and SQL Server 2000.

I have created a simple table in an SQL database. SQL server includes
ASPNET as a valid login which has unlimited access to all databases,
including the database I have created. The ASPNET account also has
full permissions on the table I have created.

I have then created a simple ASPX that attempts to connect to the
database and fill a dataset with the 3 rows that exist in the SQL
table. The code that should do this is as follows:

Dim objConn As New
SqlConnection("server=Andy;database=TestDB")
Dim strQuery As String = "SELECT * FROM Specification"
Dim dsApplication As New DataSet("Application")

' Get the data
Dim objCmd As New SqlDataAdapter(strQuery, objConn)
objCmd.Fill(dsApplication)

When I run this I get the following error on Line 27:

Description: The application attempted to perform an operation not
allowed by the security policy. To grant this application the
required permission please contact your system administrator or
change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Requested
registry access is not allowed.

Source Error:

Line 25: ' Get the data
Line 26: Dim objCmd As New SqlDataAdapter(strQuery, objConn)
Line 27: objCmd.Fill(dsApplication)

I have searched high and low on the web now for over 2 weeks to try
and resolve this to no avail. Most articles suggest the following:

a) Have you given SQL server sufficient permission. Yes I have.

b) Have you updated the web.config file to impersonate an user with
sufficient permissions. Have tried to set it up with the
administrator account for machine as follows:

[code:1:358cd43679]
<identity impersonate="true"
userName="ANDY\Administrator" password="xxxxxxxx"
/>
[/code:1:358cd43679]
Get the following error:

Parser Error Message: Could not create Windows user token from the
credentials specified in the config file. Error from the operating
system 'A required privilege is not held by the client. '

c) Change the asp.NET user account name in the machine.config
to "SYSTEM". Made no difference.

d) Followed Microsoft's KB article 329291 to Create an event source
under the Application event log in Registry Editor. Made no
difference.

e) Modify the database connection string to explicity name the ASPNET
account, the sa account, the machines Administrator account. None of
them made any difference.
I am completely stuck and if I can't get past this then i'm going to
just dump all the .NET books and Visual Studio .Net and go back to
VB6 and ASP.

Any help or ideas would be very very gratefully received :D

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 18 '05 #1
0 788

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mpriem | last post by:
I am developing a C# windows application which will act as an frontend for a SQL 2000 database. I am using a laptop with SQl 2000 workgroup edition (sp4). SQL is setup to use windows...
0
by: AndyAFCW | last post by:
I am developing my first .NET application that connects to a SQL Server 2000 database and I am having a total nightmare :x :evil: I am running Windows 2000 with Visual Studio .NET version...
1
by: Dave | last post by:
I have a ASP.net application that work fine with IIS 5.0. I'm trying to put it on IIS 6.0. And getting the following error. ASP is enable It is in a virtual directory - I also follow the...
1
by: Keith F. | last post by:
Hi, I have an asp.net web app that is intermittently throwing "Thread was being aborted." errors in my data access component. This seems to occur when the app is under a heavier than normal load....
3
by: Keith F. | last post by:
Hi, I have an asp.net web app that is intermittently throwing "Thread was being aborted." errors in my data access component. This seems to occur when the app is under a heavier than normal load....
3
by: Jim in Arizona | last post by:
I'm going insane! I don't know if it's just that the .net 2.0 framework is buggy or if it really is my code. This is pretty hard to explain since I can't even begin to nail down why this is...
6
by: Brett | last post by:
Not sure what the problem is here... Trying to update from a datagrid to an access database using vb.net... Its not updating the database but Im not getting any errors... Here is my code... ...
13
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a...
6
by: | last post by:
I've written a very small ASP.NET page to scrape thousands of pages of content based on database IDs. It loops through a dataset to get the IDs. It worked well in testing but now I am getting an...
2
by: BillE | last post by:
I am developing locally processed reports with VB2005, displayed in a report viewer on a web form. Unfortunately my environment does not permit integrated security. How can I supply the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.