H
Harlan Messinger
I installed the Northwind database in my SQL Server developer version,
added [MyMachine\ASPNET] to the server logins, and in OSQL ran
use Northwind
GO
grant all to [MyMachine\ASPNET]
GO
These executed without error. But my test page is being denied access.
Learning to bind a datagrid to a SQL table for the first time, after
creating the connection and the adapter and all that, my code-behind
class has, in InitializeComponent:
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.dsCustomers1 = new _315c05.dsCustomers();
((System.ComponentModel.ISupportInitialize)(this.dsCustomers1)).BeginInit();
and, later,
this.sqlConnection1.ConnectionString = "workstation id=MYMACHINE;packet
size=4096;integrated security=SSPI;data source=MYM" +
"ACHINE;persist security info=False;initial catalog=Northwind";
followed by a bunch of mappings.
In Page_Load I have
sqlDataAdapter1.Fill(dsCustomers1, "Customers");
dgCustomers.DataBind();
Finally, my datagrid has DataSource set to dsCustomers1, DataMember set
to Customers, and DataKeyField set to CustomerID.
When I run the page, I get an error on the DataFill call:
Cannot open database requested in login 'Northwind'. Login fails. Login
failed for user 'MYMACHINE\ASPNET'.
I can see the contents of the Customers table just fine if I
double-click on it under the Data Connections section of Server Explorer
in Visual Studio.
Any ideas?
added [MyMachine\ASPNET] to the server logins, and in OSQL ran
use Northwind
GO
grant all to [MyMachine\ASPNET]
GO
These executed without error. But my test page is being denied access.
Learning to bind a datagrid to a SQL table for the first time, after
creating the connection and the adapter and all that, my code-behind
class has, in InitializeComponent:
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.dsCustomers1 = new _315c05.dsCustomers();
((System.ComponentModel.ISupportInitialize)(this.dsCustomers1)).BeginInit();
and, later,
this.sqlConnection1.ConnectionString = "workstation id=MYMACHINE;packet
size=4096;integrated security=SSPI;data source=MYM" +
"ACHINE;persist security info=False;initial catalog=Northwind";
followed by a bunch of mappings.
In Page_Load I have
sqlDataAdapter1.Fill(dsCustomers1, "Customers");
dgCustomers.DataBind();
Finally, my datagrid has DataSource set to dsCustomers1, DataMember set
to Customers, and DataKeyField set to CustomerID.
When I run the page, I get an error on the DataFill call:
Cannot open database requested in login 'Northwind'. Login fails. Login
failed for user 'MYMACHINE\ASPNET'.
I can see the contents of the Customers table just fine if I
double-click on it under the Data Connections section of Server Explorer
in Visual Studio.
Any ideas?