我要刪除一個資料,順便刪除相關的資料表中屬於此資料SID的資料
但是一直執行SQL也很煩,找了可以一次執行多行的寫法
重點是要用分號隔開
StringBuilder sb = new StringBuilder();
sb.Append(@"BEGIN
delete from table1 where SID=:SID ;
delete from table2 where SID=:SID ;
delete from table3 where SID=:SID ;
delete from table4 where SID=:SID ;
delete from table5 where SID=:SID ;
END;
");
try
{
cnn.Open();
using (OracleCommand cmm = new OracleCommand(sb.ToString(), cnnTSTM))
{
cmm.Parameters.Clear();
cmm.Parameters.Add(new OracleParameter("SID", SID));
cmm.ExecuteNonQuery();
}
cnn.Close();
}
2015年5月22日 星期五
2015年5月11日 星期一
用ExchangeService API (EWS) 確認EMAIL信箱位址是否存在
string sResult = "";
List<string> emailCollect = new List<string>();
ExchangeService es = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
es.Credentials = new System.Net.NetworkCredential("ACCOUNT", "PASSWORD", "NETAREA");
es.Url = new Uri("https://MYWEBSITE/ews/Exchange.asmx");
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
var resolvedNames = es.ResolveName("想找的姓名或帳號");
foreach (var resolvedName in resolvedNames)
{
emailCollect.Add(resolvedName.Mailbox.Address);
}
if (emailCollect.Count > 0)
{
sResult = emailCollect[0].ToString().Trim();
Console.WriteLine(sResult);
}
else
Console.WriteLine("找不到信箱!");
List<string> emailCollect = new List<string>();
ExchangeService es = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
es.Credentials = new System.Net.NetworkCredential("ACCOUNT", "PASSWORD", "NETAREA");
es.Url = new Uri("https://MYWEBSITE/ews/Exchange.asmx");
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
var resolvedNames = es.ResolveName("想找的姓名或帳號");
foreach (var resolvedName in resolvedNames)
{
emailCollect.Add(resolvedName.Mailbox.Address);
}
if (emailCollect.Count > 0)
{
sResult = emailCollect[0].ToString().Trim();
Console.WriteLine(sResult);
}
else
Console.WriteLine("找不到信箱!");
標籤:
找信箱是否存在,
C#,
EWS,
ExchangeService
2015年5月5日 星期二
RDLC 文字方塊 增大 超出
發現一張表的文字方塊有的超出寬度與高度後會撐大,
有的只會換行然後超出邊界的部分就截掉
解決方式
文字方塊右鍵→屬性→一般頁面裡的[調整大小選項]把允許高度增加給取消打勾就好了
有的只會換行然後超出邊界的部分就截掉
解決方式
文字方塊右鍵→屬性→一般頁面裡的[調整大小選項]把允許高度增加給取消打勾就好了
訂閱:
文章 (Atom)