I am working on a web project, where multiple users can save information.
For saving information of user i have written two stored procedure one for inserting user data and one for delete previously inserted data depending upon some condition.There is another stored procedure used to bind reports of that employee to grid and this procedure contains only select statement and it is called after calling above two sp.
The above stored procedures using same table 'EmpDetails'.
My Problem is that, when single user saves the information, the information is saving correctly, but when i have tasted for two users for same time it is giving me issues when i click on save button,like my third sp didnt get correct reports for employee.
To solve this issue i have used transactions, but it didnt worked for me and i get followig error,
2012-12-25 12:17:14,197  ERROR Admin Unable to cast object of type 'System.Int32' to type 'System.String'.
System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
at System.Data.SqlClient.SqlDataReader.GetString(Int32 i)
at System.Web.Security.SqlRoleProvider.GetRolesForUser(String username)
at System.Web.Security.Roles.GetRolesForUser(String username)
at Admin.Page_Load(Object sender, EventArgs e) in c:\Projects On IIS\SKFSheet20Dec_For_Test\Admin.master.cs:line 37
at this location:
string uname = Session["UserName"].ToString();
string userroles = Roles.GetRolesForUser(uname);
So please give me suggestion to solve this issue.