473,395 Members | 1,891 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,395 software developers and data experts.

method Fill - problem

Hello Everybody

SqlConnection conn = new SqlConnection(str);

DataSet dataSet = new DataSet();
SqlDataAdapter dataAdap = new SqlDataAdapter("select * from Region", conn);

conn.Open();
dataAdap.Fill(dataSet, "Region");

I have porblem with method Fill. When i don't coment line with
dataAdap.Fill(dataSet, "Region"); in my browser appears error:

SELECT permission denied on object 'Region', database 'Northwind', owner
'dbo'.
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: SELECT permission
denied on object 'Region', database 'Northwind', owner 'dbo'.

Source Error:

Line 30:
Line 31: conn.Open();
Line 32: dataAdap.Fill(dataSet,"Region");
Line 33:
Line 34:
When line 32: is coment application is runnign corect:

thanks for all respond
'harry'
Nov 19 '05 #1
3 1014
In order to select information from a table in a SQL Server database, the
user referenced in your connection string must have permissions to do so.
Contact your database administrator to set up that user account with select
permissions on the table. Hope this helps.

Richard

"Pawel Blochowiak" wrote:
Hello Everybody

SqlConnection conn = new SqlConnection(str);

DataSet dataSet = new DataSet();
SqlDataAdapter dataAdap = new SqlDataAdapter("select * from Region", conn);

conn.Open();
dataAdap.Fill(dataSet, "Region");

I have porblem with method Fill. When i don't coment line with
dataAdap.Fill(dataSet, "Region"); in my browser appears error:

SELECT permission denied on object 'Region', database 'Northwind', owner
'dbo'.
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: SELECT permission
denied on object 'Region', database 'Northwind', owner 'dbo'.

Source Error:

Line 30:
Line 31: conn.Open();
Line 32: dataAdap.Fill(dataSet,"Region");
Line 33:
Line 34:
When line 32: is coment application is runnign corect:

thanks for all respond
'harry'

Nov 19 '05 #2
thank you 4 your help
i thought about access to the data base, but my users haven't requirement
permissons

now is okay
by
Nov 19 '05 #3
Pawelku,
Its a security issue and adequate access to the Database.
Trzymanko
Patrick
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #4

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

Similar topics

0
by: Homauoon Mahboobi | last post by:
I open one SQLConnection,create a SqlDataAdapter and SqlDtaSet and then run some queries with ExecuteNonQuery method of SqlCommand object.When i use Fill method of DataAdapter object,it adds all...
1
by: Jose | last post by:
Hello: I'm preparing a multitier application, and in the Data Layer I have a EmployeeRepositoryBase class that has a protected static method called Fill() and some GetAll() overloaded protected...
1
by: Ryan McLean | last post by:
Hi everyone! What is happening is the method: sub_btnSubmitClicked is being executed every time any other object with a Handler is executed. I am trying not to use the withevents and handles...
4
by: Mervin Williams | last post by:
I have several tables involved in my application, but the two in question here are the company and address tables. The company table has business_address_id and mailing_address_id columns, which...
2
by: Bernie Yaeger | last post by:
Is there any way to get into the internals of the data adapter fill method such that I could know its progress status? For example, using the fill method to load a 40,000 row table takes just a...
15
by: graham | last post by:
Hi all, <bitching and moaning section> I am asking for any help I can get here... I am at the end of my tether... I don;t consider myself a genius in any way whatsoever, but I do believe I have...
5
by: moondaddy | last post by:
I have a website where cataloge pages are populated by calling a stored procedure on sql server. I use the sql data adapter's fill method to call this stored procedure and fill the dataset. about...
1
by: mivey4 | last post by:
Okay, The problem is that I have an Access Database that has the following fields: EmpID - Autonumber (PrimaryKey) AccountID - Text IssueReported - Memo DateOpened ...
4
by: Julien Jorge | last post by:
Hi, I have a compilation-time error on the specialization of a method from a imbricated template class, and I can't figure why. The problematic part of the code is resumed below. The error occurs...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.