Skip to content

Instantly share code, notes, and snippets.

@pfalabella
Last active December 18, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfalabella/5796348 to your computer and use it in GitHub Desktop.
Save pfalabella/5796348 to your computer and use it in GitHub Desktop.
// linqPad snippet
void Main()
{
CleanRecords();
}
public void CleanRecords()
{
StringBuilder builder = new StringBuilder();
string delimiter = "";
var res=Enumerable.Range(1, 15);
foreach(var r in res)
{
builder.Append(delimiter);
builder.Append(r.ToString());
delimiter = ",";
}
UpdateRecords(builder.ToString());
}
public void UpdateRecords(string rowIDs)
{
Console.WriteLine("UPDATE `cash_data` SET `end_date`='" + GetMeDate() + "', `user`='1' WHERE `id` IN (" + rowIDs + ")");
}
private string GetMeDate()
{
return DateTime.Now.ToString("yyyy-MM-dd");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment