473,382 Members | 1,375 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,382 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:765c675442]
<identity impersonate="true"
userName="ANDY\Administrator" password="xxxxxxxx"
/>
[/code:1:765c675442]
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 [/code]

----== 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 1142

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...
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: 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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.