Posted 六月 4th, 2010 by o2ho in category
工作,
技术
1. 单个数据库连接
可以直接使用OracleTransaction对象做事务处理
using(var transaction = connection.BeginTransaction())
{
.....在这个作用域上的数据库操作,必须基于这个transaction
using(var command = new OracleCommand(commandText, connection) { Transaction = transaction })
{
...
}
...
transaction.Commit(); //transaction.Rollback();
}
2. 多个数据库连接
可以使用TransactionScope对象来维
Posted 九月 4th, 2009 by o2ho in category
技术,
资源
protected void ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if ((e.Item.ItemType.Equals(ListItemType.Item) || e.Item.ItemType.Equals(ListItemType.AlternatingItem)) && (e.Item.ItemIndex + 1) % ProductsPerPage == 0)
{
e.Item.Controls.Add(new LiteralControl("<tr><td class=\"PageBreak\" ></td></tr>"));
}
Posted 十月 27th, 2008 by o2ho in category
工作,
技术
public void EnumInstanceFromInt()
{
// The .NET Framework contains an Enum called DayOfWeek.
// Let's generate some Enum instances from int values.
// Usually you wouldn't cast an instance of an existing Enum to an int
// in order to create an Enum instance. :-) You would have the actual
// integer value, perhaps a value from a database w