This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.
Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.
Before posting questions here you might want to review the developer documentation.
Hi Joe,
I want to make a new query for a new table (created for me) in the database. I copy the structure of the function AddUser in the DBSiteUser.cs to inserta a new row in my table. I don´t know how to create the object SqlParameterHelper becasuse i don´t know what is the second parameter ("me_Users_Insert"). Where is defined that string??
Thanks Joe.
public static int AddUser( Guid siteGuid, int siteId, string fullName, String loginName, string email, string password, Guid userGuid, DateTime dateCreated) {
SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_Users_Insert", 8); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId); sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 100, ParameterDirection.Input, fullName); sph.DefineSqlParameter("@LoginName", SqlDbType.NVarChar, 50, ParameterDirection.Input, loginName); sph.DefineSqlParameter("@Email", SqlDbType.NVarChar, 100, ParameterDirection.Input, email); sph.DefineSqlParameter("@Password", SqlDbType.NVarChar, 128, ParameterDirection.Input, password); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); sph.DefineSqlParameter("@DateCreated", SqlDbType.DateTime, ParameterDirection.Input, dateCreated); int newID = Convert.ToInt32(sph.ExecuteScalar()); return newID; }
"mp_Users_Insert" is the name of a stored procedure in the database
Hope it helps,
Joe