RE: ADO.NET help - Filling a DataGrid with contents of a DataSet
- From: "Elton W" <EltonW@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 4 Feb 2006 12:59:19 -0800
In web application, when you use integrated security connection, you are
using ASPNET account.
You can change in Framework machine.config
from
userName="machine" // ASPNET
to
userName="SYSTEM" // localsystem (high privilege admin)
HTH
Elton Wang
"thebison" wrote:
Hi,.
As a relative newbie to SQL Server/ASP.NET I'm hoping someone here
can help with my problem. I'm developing a time*** application in
ASP.NET C# using Visual Studio 2003 with a database built in MSDE.
One of my forms needs to return a simple list of resources from my
database. I have followed the guide on the MSDN libraries, but for
some reason I continuously get the same error message.
What I've done so far is Create the database, tables, and populate
with some sample data using using Server Explorer in Visual Studio. I
have
connected to the database (using integrated security) and I am
trying to get the contents of the Resource table to appear on my
form. I have then created a DataAdapter (tested the connection, set
the SQL as a simple SELECT * from Resource, etc), which also generates
an sqlConnection for me. To test this I have previewed the generated
data, and it returns what I want, so I
have chosen to generate a DataSet of this (dsResource). I am then
trying to get
this data into a simple DataGrid. On the properties of the DataGrid
I have changed the DataSource to point at my Dataset. As I
understand it, I then have to add the following to my Page Load
section of my code.
sqlConnection1.Open();
this.sqlDataAdapter1.Fill(this.dsResource);
sqlConnection1.Close();
The form builds fine, but when I browse to the particular form I get
the following error for the sqlConnection1.Open(); line
Exception Details: System.Data.SqlClient.SqlException: Cannot open
database requested in login 'SCMS'. Login fails. Login failed for
user 'AL-NOTEPAD\ASPNET'.
To me this is an error with my connection string. My database
instance is actually 'AL-NOTEPAD\VSDOTNET'. However the properties
for sqlConnection1 are pointing to the correct datasource. I do not
know why the application is looking for user 'AL-NOTEPAD\ASPNET'. It
does not exist, to my knowledge.
Any help with this would be greatly appreciated, as I get the same
error with my code for forms-based login...
Thanks in advance..
- Follow-Ups:
- Re: ADO.NET help - Filling a DataGrid with contents of a DataSet
- From: dehranph@xxxxxxxxx
- Re: ADO.NET help - Filling a DataGrid with contents of a DataSet
- References:
- ADO.NET help - Filling a DataGrid with contents of a DataSet
- From: thebison
- ADO.NET help - Filling a DataGrid with contents of a DataSet
- Prev by Date: Re: ADO.NET help - Filling a DataGrid with contents of a DataSet
- Next by Date: Re: How to close connection pool?
- Previous by thread: Re: ADO.NET help - Filling a DataGrid with contents of a DataSet
- Next by thread: Re: ADO.NET help - Filling a DataGrid with contents of a DataSet
- Index(es):