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

sqlDataAdapter1.Fill(dataSet1) produces permissions error

Hi.

My colleague and I have followed the procedure to populate a form with
data from a database, using this code:

private void bindGrid()
{
sqlConnection1.Open();
sqlDataAdapter1.Fill(dataSet1);
DataGrid1.DataBind();
sqlConnection1.Close();

}

When we run this, we get the following error message:

Server Error in '/ESSWebForm' Application.
------------------------------------------------------------------------
--------

SELECT permission denied on object 'sf1', database 'UCLA', owner 'dbo'.
Source Error:
Line 45: sqlDataAdapter1.Fill(dataSet1);

We followed instructions that included running sp_grantlogin and
sp_grantdbaccess for the user.

And now we're stuck. We can't figure out how to get access to tables and
other database objects.

In general, we're confused about where in VS .NET we program in
authentication/permissions.

Any help greatly appreciated

Thanks,
Google Jenny
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #1
5 2697
Jenny,

Presumably you have a connection string somewhere, that the SqlConnection
object uses to connect to your database? That should contain details (a
username and password) of the account you're using to login to the database.
And it sounds like your database is SQL Server, is this right? The account
you login to the database as must have the appropriate permissions for
whatever it is you're trying to do (SELECT in this case), and these are set
in SQL Server.

Can you verify that what database you are connecting to, and that the
details in the connection string correspond to a login? Sorry if this isn't
much help, but with the details you provided it's difficult to be more
specific.

Toby Mathews

"Google Jenny" <mi******@yahoo.com> wrote in message
news:u2**************@TK2MSFTNGP09.phx.gbl...
Hi.

My colleague and I have followed the procedure to populate a form with
data from a database, using this code:

private void bindGrid()
{
sqlConnection1.Open();
sqlDataAdapter1.Fill(dataSet1);
DataGrid1.DataBind();
sqlConnection1.Close();

}

When we run this, we get the following error message:

Server Error in '/ESSWebForm' Application.
------------------------------------------------------------------------
--------

SELECT permission denied on object 'sf1', database 'UCLA', owner 'dbo'.
Source Error:
Line 45: sqlDataAdapter1.Fill(dataSet1);

We followed instructions that included running sp_grantlogin and
sp_grantdbaccess for the user.

And now we're stuck. We can't figure out how to get access to tables and
other database objects.

In general, we're confused about where in VS .NET we program in
authentication/permissions.

Any help greatly appreciated

Thanks,
Google Jenny
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #2
Jenny,

Presumably you have a connection string somewhere, that the SqlConnection
object uses to connect to your database? That should contain details (a
username and password) of the account you're using to login to the database.
And it sounds like your database is SQL Server, is this right? The account
you login to the database as must have the appropriate permissions for
whatever it is you're trying to do (SELECT in this case), and these are set
in SQL Server.

Can you verify that what database you are connecting to, and that the
details in the connection string correspond to a login? Sorry if this isn't
much help, but with the details you provided it's difficult to be more
specific.

Toby Mathews

"Google Jenny" <mi******@yahoo.com> wrote in message
news:u2**************@TK2MSFTNGP09.phx.gbl...
Hi.

My colleague and I have followed the procedure to populate a form with
data from a database, using this code:

private void bindGrid()
{
sqlConnection1.Open();
sqlDataAdapter1.Fill(dataSet1);
DataGrid1.DataBind();
sqlConnection1.Close();

}

When we run this, we get the following error message:

Server Error in '/ESSWebForm' Application.
------------------------------------------------------------------------
--------

SELECT permission denied on object 'sf1', database 'UCLA', owner 'dbo'.
Source Error:
Line 45: sqlDataAdapter1.Fill(dataSet1);

We followed instructions that included running sp_grantlogin and
sp_grantdbaccess for the user.

And now we're stuck. We can't figure out how to get access to tables and
other database objects.

In general, we're confused about where in VS .NET we program in
authentication/permissions.

Any help greatly appreciated

Thanks,
Google Jenny
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #3
Hi, Toby.

We're using the generic MSDE server that comes with Visual Studio .NET.

While researching this, I've come across instructions to go to Microsoft
SQL Server in the Start Menu and configure permissions in some submenus
of that branch. But I have no such entry in my start menu.

YET! Under Server Explorer, it lists my server as a SQL Server.

Regarding the connection string:
Curiously, the connection string property for sqlConnection1 contains no
user name or password elements.

Flummoxed,
Google Jenny

P.S. My colleague is on the phone with MS tech support now, using up one
of his last free chits.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #4
Hi, Toby.

We're using the generic MSDE server that comes with Visual Studio .NET.

While researching this, I've come across instructions to go to Microsoft
SQL Server in the Start Menu and configure permissions in some submenus
of that branch. But I have no such entry in my start menu.

YET! Under Server Explorer, it lists my server as a SQL Server.

Regarding the connection string:
Curiously, the connection string property for sqlConnection1 contains no
user name or password elements.

Flummoxed,
Google Jenny

P.S. My colleague is on the phone with MS tech support now, using up one
of his last free chits.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #5
Jenny,

Ok, well I'm afraid I haven't had much experience with MSDE, but I would
say that's where your permissions would be - hopefully tech support have put
you on the right track though!

Toby

"Google Jenny" <mi******@yahoo.com> wrote in message
news:eP****************@TK2MSFTNGP12.phx.gbl...
Hi, Toby.

We're using the generic MSDE server that comes with Visual Studio .NET.

While researching this, I've come across instructions to go to Microsoft
SQL Server in the Start Menu and configure permissions in some submenus
of that branch. But I have no such entry in my start menu.

YET! Under Server Explorer, it lists my server as a SQL Server.

Regarding the connection string:
Curiously, the connection string property for sqlConnection1 contains no
user name or password elements.

Flummoxed,
Google Jenny

P.S. My colleague is on the phone with MS tech support now, using up one
of his last free chits.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #6

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

Similar topics

1
by: mmc | last post by:
I'm getting the error "Login failed for the user NT Authority\Network Service" I'm running this application in visual studio and the app is supposed to fill a datagrid from an SQL Server Db. Could...
0
by: Rich | last post by:
Getting error on insert when I try to add a new row to a dataset; used Visual Studio IDE to generate stored procedures, data adapter, and dataset. Table on SQL server has a column marked non-null....
0
by: Rich | last post by:
I've used VS2003 Wizard to create sqlDataAdapter, stored procedures, and dataset on my application. I can search and update fine but Insert has error unless I perform a search or update prior to my...
4
by: Wayne Wengert | last post by:
I am attempting to follow a walkthrough that builds an ASP.Net page with a datagrid that can be edited. I modified the example to use one of my tables on a SQL 2000 Server. I built the sqladapter,...
1
by: fl | last post by:
I am running ASPNET on my local machine. I have a problem when I try to connect to a SQL server database table. The data looks good when I right click SqlDataAdapter1 to preview the data. When F5...
1
by: JackO | last post by:
I have a SQL table (tblUser) that has the following design: Col Dtype Len Nulls UserID varchar 10 0 Password varchar 10 0 FirstName varchar 10 0 LastName varchar 10 0 Type char 5 0...
3
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an...
3
by: Frustrated Developer via DotNetMonster.com | last post by:
I have developed a form that would allow the user to load and search a database several ways, by data range, by specific number or all database entries. I can successfully load any of the ways...
3
by: Google Jenny | last post by:
Hi. My colleague and I have followed the procedure to populate a form with data from a database, using this code: private void bindGrid() { sqlConnection1.Open();...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.