/// <summary> /// Add a value that should be parameterized, and returns a id. /// If this <see cref="SqlOptions"/>.UseParameters is false, when the value will be returned as a string. /// </summary> /// <param name="value">The value to be added.</param> public virtual string CreateItemID(object value) { if (UseParameters) { var id = "@item" + ItemIdCount++; SqlItems.Add(new SqlItem(id, HandleObject(value))); return(id); } var obj = HandleObject(value); return(obj is string?$"'{obj}'" : obj.ToString()); }
/// <summary> /// Remove all items that has been added to this <see cref="SqlOptions"/>. /// </summary> public virtual void ClearItems() { SqlItems.Clear(); ItemIdCount = 0; }
private void FilterGrid() { SqlItems.FilterExpression = "nam like '%" + txtSearch.Value + "%'"; SqlItems.DataBind(); gridItems.DataBind(); }