本文整理汇总了C#中System.Web.UI.WebControls.ObjectDataSource.DataObjectTypeName属性的典型用法代码示例。如果您正苦于以下问题:C# ObjectDataSource.DataObjectTypeName属性的具体用法?C# ObjectDataSource.DataObjectTypeName怎么用?C# ObjectDataSource.DataObjectTypeName使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Web.UI.WebControls.ObjectDataSource
的用法示例。
在下文中一共展示了ObjectDataSource.DataObjectTypeName属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AggregateData
//引入命名空间
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace Samples.AspNet.CS
{
/// <summary>
/// Summary description for AggregateData
/// </summary>
public class AggregateData
{
public AggregateData()
{
}
static DataTable table;
private DataTable CreateData()
{
table = new DataTable();
table.Columns.Add("Name", typeof(string));
table.Columns.Add("Number", typeof(int));
table.Rows.Add(new object[] { "one", 1 });
table.Rows.Add(new object[] { "two", 2 });
table.Rows.Add(new object[] { "three", 3 });
return table;
}
public DataTable Select()
{
if (table == null)
{
return CreateData();
}
else
{
return table;
}
}
public int Insert(NewData newRecord)
{
table.Rows.Add(new object[] { newRecord.Name, newRecord.Number });
return 1;
}
}
public class NewData
{
private string nameValue;
private int numberValue;
public string Name
{
get { return nameValue; }
set { nameValue = value; }
}
public int Number
{
get { return numberValue; }
set { numberValue = value; }
}
}
}