Esempio n. 1
0
        public void Insert(IDbConnection cn, YZSoft.Web.BPA.SpriteIdentity spriteIdentity)
        {
            using (OracleCommand cmd = new OracleCommand())
            {
                cmd.Connection = cn as OracleConnection;
                cmd.BindByName = true;

                StringBuilder sb = new StringBuilder();
                sb.Append("INSERT INTO BPASpriteIdentity(");
                sb.Append("FileID,");
                sb.Append("SpriteID,");
                sb.Append("Name) ");
                sb.Append("VALUES(");
                sb.Append(":FileID,");
                sb.Append(":SpriteID,");
                sb.Append(":Name)");
                cmd.CommandText = sb.ToString();

                cmd.Parameters.Add(":FileID", OracleDbType.NVarchar2).Value   = this.Convert(spriteIdentity.FileID, false);
                cmd.Parameters.Add(":SpriteID", OracleDbType.NVarchar2).Value = this.Convert(spriteIdentity.SpriteID, false);
                cmd.Parameters.Add(":Name", OracleDbType.NVarchar2).Value     = this.Convert(spriteIdentity.Name, true);

                cmd.ExecuteNonQuery();
            }
        }
Esempio n. 2
0
        public void Insert(IDbConnection cn, YZSoft.Web.BPA.SpriteIdentity spriteIdentity) //uu1uu
        {
            using (SqlCommand cmd = new SqlCommand())
            {
                cmd.Connection = cn as SqlConnection;

                StringBuilder sb = new StringBuilder();
                sb.Append("INSERT INTO BPASpriteIdentity(");
                sb.Append("FileID,");
                sb.Append("SpriteID,");
                sb.Append("Name) ");
                sb.Append("VALUES(");
                sb.Append("@FileID,");
                sb.Append("@SpriteID,");
                sb.Append("@Name)");
                cmd.CommandText = sb.ToString();

                cmd.Parameters.Add("@FileID", SqlDbType.NVarChar).Value   = this.Convert(spriteIdentity.FileID, false);
                cmd.Parameters.Add("@SpriteID", SqlDbType.NVarChar).Value = this.Convert(spriteIdentity.SpriteID, false);
                cmd.Parameters.Add("@Name", SqlDbType.NVarChar).Value     = this.Convert(spriteIdentity.Name, true);

                cmd.ExecuteNonQuery();
            }
        }