Franken_.App_Code.DataPipe.FixString C# (CSharp) Method

FixString() public method

public FixString ( string DirtyString ) : string
DirtyString string
return string
        public string FixString(string DirtyString)
        {
            string FixedString = DirtyString.Replace("\\", "\\\\")
                .Replace("'", "''");

            return FixedString;
        }

Usage Example

Example #1
0
 public void Save()
 {
     if (this.ID == "")
     {
         this.ID = db.GetNewID("images");
         db.ExecuteCommand("insert into images (img_id, img_glyph_id, img_path, img_status) values (" + this.ID + ", " + this.GlyphID + ", '" + db.FixString(this.Path) + "', '" + db.FixString(this.Status) + "')");
     }
     else
     {
         db.ExecuteCommand("update images set img_glyph_id = " + this.GlyphID + ", " +
                           "img_path = '" + db.FixString(this.Path) + "', " +
                           "img_status = '" + db.FixString(this.Status) + "' " +
                           "where img_id = " + this.ID);
     }
 }
All Usage Examples Of Franken_.App_Code.DataPipe::FixString