Permission issue with SQLDataSource?

  • Thread starter Thread starter perplexed
  • Start date Start date
P

perplexed

I'd like a small overview of requirements for inserting data into a
database with SQLDataSource in regards to permissions. In the
Page_Load(), my code looks similar to this (sorry, I don't have the
code with me now):

SqlDataSource mysource = new SqlDataSource("SQLClient", myconn,
CommandType.Text );
mysource.Insert( );

The above works fine when I'm local (192.168.1.100) but once I try to
access from the outside, it fails. I'm guessing perhaps because some
type of ASPNET user is not added into SQL Server 2005 users and does
not have access to the table. What are the correct steps to allow the
code to run?

I will be using a stored procedure in place of text.

Thanks,
john
 
Your guess sounds right. You need to setup proper database connection.
Either introduce the asp.net user to the sql server and use windows
authentication or use sql authentication with user name and password.
 
Thanks. I added correct permissions for network service account.
That's ok since this is local.
 
Back
Top