J
Jiggaz
Hi,
In my ASPX Page, i have a form for signup. And whene user
click on the button, the event Button1_Click must use a
stored procedure.
But instead of use stored proc, i get this exception :
_____
System.Data.SqlClient.SqlException: EXECUTE permission
denied on object 'CreateAccount', database 'wizou', schema
'dbo'. at
System.Data.SqlClient.SqlConnection.OnError(SqlException
exception, TdsParserState state) at
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, TdsParserState state) at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) at
System.Data.SqlClient.TdsParser.Run(RunBehavior
runBehavior, SqlCommand cmdHandler, SqlDataReader
dataStream, BulkCopySimpleResultSet bulkCopyHandler,
TdsParserStateObject stateObj) at
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
ds, RunBehavior runBehavior, String resetOptionsString) at
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream,
String method, DbAsyncResult result) at
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result) at
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at
Signup.Button1_Click(Object sender, EventArgs e) in
c:\Inetpub\wwwroot\wizou\Signup.aspx.cs:line 114
_____
AND MY CODE IS :
SqlCommand myCommand = new SqlCommand();
String strCnx =
ConfigurationSettings.ConnectionStrings["AppCnxStr"].ConnectionString.ToString();
myCommand.Connection = new SqlConnection(strCnx);
myCommand.Connection.Open();
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandText = "CreateAccount";
SqlParameter myNickname = new SqlParameter("@Nickname",
SqlDbType.NVarChar, 30);
myNickname.Value = boxLogin.Text;
myCommand.Parameters.Add(myNickname);
SqlParameter myPassword = new SqlParameter("@Password",
SqlDbType.NVarChar, 15);
myPassword.Value = boxPwd.Text;
myCommand.Parameters.Add(myPassword);
....
myCommand.ExecuteNonQuery();
System.Web.Security.FormsAuthentication.SetAuthCookie(boxLogin.Text,
true);
Response.Redirect("/Signup.aspx?action=Complete");
_______________________
Regards.
In my ASPX Page, i have a form for signup. And whene user
click on the button, the event Button1_Click must use a
stored procedure.
But instead of use stored proc, i get this exception :
_____
System.Data.SqlClient.SqlException: EXECUTE permission
denied on object 'CreateAccount', database 'wizou', schema
'dbo'. at
System.Data.SqlClient.SqlConnection.OnError(SqlException
exception, TdsParserState state) at
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, TdsParserState state) at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) at
System.Data.SqlClient.TdsParser.Run(RunBehavior
runBehavior, SqlCommand cmdHandler, SqlDataReader
dataStream, BulkCopySimpleResultSet bulkCopyHandler,
TdsParserStateObject stateObj) at
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
ds, RunBehavior runBehavior, String resetOptionsString) at
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream,
String method, DbAsyncResult result) at
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result) at
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at
Signup.Button1_Click(Object sender, EventArgs e) in
c:\Inetpub\wwwroot\wizou\Signup.aspx.cs:line 114
_____
AND MY CODE IS :
SqlCommand myCommand = new SqlCommand();
String strCnx =
ConfigurationSettings.ConnectionStrings["AppCnxStr"].ConnectionString.ToString();
myCommand.Connection = new SqlConnection(strCnx);
myCommand.Connection.Open();
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandText = "CreateAccount";
SqlParameter myNickname = new SqlParameter("@Nickname",
SqlDbType.NVarChar, 30);
myNickname.Value = boxLogin.Text;
myCommand.Parameters.Add(myNickname);
SqlParameter myPassword = new SqlParameter("@Password",
SqlDbType.NVarChar, 15);
myPassword.Value = boxPwd.Text;
myCommand.Parameters.Add(myPassword);
....
myCommand.ExecuteNonQuery();
System.Web.Security.FormsAuthentication.SetAuthCookie(boxLogin.Text,
true);
Response.Redirect("/Signup.aspx?action=Complete");
_______________________
Regards.