SELECT o.name AS TableName, c.name AS ColumName
FROM syscolumns c JOIN sysobjects o
ON c.id = o.id
WHERE c.name like '%account%'
ORDER BY o.name, c.name
more...
SELECT o.name AS TableName, c.name AS ColumName
FROM syscolumns c JOIN sysobjects o
ON c.id = o.id
WHERE c.name like '%account%'
ORDER BY o.name, c.name
abstract public class AbstractXMLObject
{
public string XML
{
get
{
XmlSerializer xmlSerializer = new XmlSerializer(this.GetType());
StringWriter stringWriter = new StringWriter();
xmlSerializer.Serialize(stringWriter,this);
return stringWriter.ToString();
}
set
{
XmlSerializer xmlSerializer = new XmlSerializer(this.GetType());
StringReader stringReader = new StringReader(value);
this = xmlSerializer.Deserialize(stringReader);
}
}
}
0.Create MultiThreadArgument class and add all parameters for thread starting
public class MultiThreadArgument {
public MerchantBase merchant;
public TransactionCollection transactionCollection;
public string email;
}
1.Thread starter in main thread class (thread class):
private void ThreadStarter(MerchantBase m, TransactionCollection c,string email){
if (c.Count > 0) {
Thread th = new Thread(new ParameterizedThreadStart(ThreadWorker));
// create class parameters :
MultiThreadArgument ma = new MultiThreadArgument();
ma.merchant = m;
ma.transactionCollection = c;
ma.email = email;
th.IsBackground = true;
th.Start(ma);
}
}
2.Thread worker in main class:
private void ThreadWorker(Object o) {
MultiThreadArgument ma = (MultiThreadArgument)o;
DateTime st = DateTime.Now;
string mid = ma.merchant.ID.ToString();
Logger.prn("*** Processing started for merchant #", mid , "transactions - ", ma.transactionCollection.Count.ToString());
ma.merchant.ProcessRequest(ma.transactionCollection, this);
.....
}
string[] newarr = new string[oldarr.Length + 1];
oldarr.CopyTo(newarr, 0);
newarr[newarr.Length-1] = "new element";
return newarr;
string file_extention;
string file_name;
file_name=Path.GetFileName(this.mffFileName);
file_extention = Path.GetExtension(this.mffFileName);
[ws][-]{ d | [d.]hh:mm[:ss[.ff]] }[ws]
Item | Description |
---|---|
ws | optional white space |
"-" | optional minus sign indicating a negative TimeSpan |
d | days, ranging from 0 to 10675199 |
hh | hours, ranging from 0 to 23 |
mm | minutes, ranging from 0 to 59 |
ss | optional seconds, ranging from 0 to 59 |
ff | optional fractional seconds, consisting of 1 to 7 decimal digits |
The components of s must collectively specify a time interval greater than or equal to MinValue and less than or equal to MaxValue.
1 public static implicit operator bool(Result p){
2 return p.Status == enResultStatus.OK;
3 }
4
5 private const string of = "\nResult:\n\tstatus:{0}\n\tdesc:{1}\n\tMsg:{2}\n\tException:{3}\n\tval:{4}\n\tSuggested:{5}";
6 public static implicit operator string(Result p) {
7 return String.Format(of, p.Status , p.Description, p.UserFriendlyErrorMsg,p.ExeptionHappend,p.Value,p.SuggestedValue);
8 }
15 Result res;
16 if (res) {
17 Debug.WriteLine("Dump of result object :"+res )
18 }
// sorting class
public class InvoiceSorterbyDueDate : System.Collections.Generic.IComparer<BaseObject>
{
#region IComparer<Invoice> Members
public int Compare(BaseObject x, BaseObject y){
return ((Invoice)x).DueDate.CompareTo(((Invoice)y).DueDate);
}
#endregion
}
//call
IComparer<BaseObject> ins = new InvoiceSorterbyDueDate();
p.InvoiceCollectionToCheck.Sort(ins);
//
1 import timemore...
2 timestring = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))
Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...