The SqlRoleProvider.AddUsersToRoles(String[], String[]) method is called by the System.Web.Security.Roles class to associate one or more users with one or more roles in the SQL Server database specified in the ASP.NET application's configuration file (Web.config). This method is called by the Roles.AddUserToRole(string, string), Roles.AddUserToRoles(string, String[]), Roles.AddUsersToRole(String[], string), and Roles.AddUsersToRoles(String[], String[]) methods of the System.Web.Security.Roles class.
The database updates that are performed during the call to the SqlRoleProvider.AddUsersToRoles(String[], String[]) method are made within a transaction. If an error is encountered, such as a user name that is already in a specified role, the transaction is rolled back and no updates are performed.
If the System.Web.Security.SqlRoleProvider is being used with the System.Web.Security.SqlMembershipProvider, and one of the specified user names does not exist in the database, the user name will be automatically added to the database.
User names and role names cannot contain commas.