method Fill - problem

P

Pawel Blochowiak

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'
 
G

Guest

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
 
P

Pawel Blochowiak

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

now is okay
by
 
P

Patrick Olurotimi Ige

Pawelku,
Its a security issue and adequate access to the Database.
Trzymanko
Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top