示例#1
0
    //插入->添加的是一整条的数据  如果有主键  先判断主键是否存在了 返回插入结果 isSingle是否保持唯一性
    public bool Insert(UserInfo UserInfo)
    {
        //ikey需要通过运算获得
        //ivalue需要通过append
        //string sqlCmd = "insert into userinfo_a("+ikey+") values("+ivalues+")";
        string sqlCmd = "insert into userinfo_a(Account,Password)  values(" + "\"" + UserInfo.Account + "\""
                        + "," + "\"" + UserInfo.Password + "\""
                        + ")";
        bool b = MySqlHelper.AddCMD(ConnectType.GAME, sqlCmd);

        return(b);
    }
示例#2
0
    //插入->添加的是一整条的数据  如果有主键  先判断主键是否存在了 返回插入结果 isSingle是否保持唯一性
    public bool Insert(RolesInfo RolesInfo)
    {
        //ikey需要通过运算获得
        //ivalue需要通过append
        //string sqlCmd = "insert into rolesinfo_a("+ikey+") values("+ivalues+")";
        string sqlCmd = "insert into rolesinfo_a(ID,RolesID,NickName,Level,State,VictoryPoint,GoldCoin,Diamonds,RoomID,SeatID)  values(" + RolesInfo.ID
                        + "," + RolesInfo.RolesID
                        + "," + "\"" + RolesInfo.NickName + "\""
                        + "," + RolesInfo.Level
                        + "," + RolesInfo.State
                        + "," + RolesInfo.VictoryPoint
                        + "," + RolesInfo.GoldCoin
                        + "," + RolesInfo.Diamonds
                        + "," + RolesInfo.RoomID
                        + "," + RolesInfo.SeatID
                        + ")";
        bool b = MySqlHelper.AddCMD(ConnectType.GAME, sqlCmd);

        return(b);
    }