• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WebControls.ObjectDataSourcePoker类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MonoTests.System.Web.UI.WebControls.ObjectDataSourcePoker的典型用法代码示例。如果您正苦于以下问题:C# ObjectDataSourcePoker类的具体用法?C# ObjectDataSourcePoker怎么用?C# ObjectDataSourcePoker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ObjectDataSourcePoker类属于MonoTests.System.Web.UI.WebControls命名空间,在下文中一共展示了ObjectDataSourcePoker类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ObjectDataSource_InsertParametersCaseSensitive

		public void ObjectDataSource_InsertParametersCaseSensitive ()
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			CustomObjectDataSourceView view = new CustomObjectDataSourceView (ods, "CustomView", null);
			view.TypeName = typeof (MyTableObject).AssemblyQualifiedName;
			view.SelectMethod = "GetMyData";
			view.InsertMethod = "Insert";

			Parameter p1, p2, p3;
			p1 = new Parameter ("id", TypeCode.String, "1001");
			p2 = new Parameter ("fname", TypeCode.String, "Mahesh");
			p3 = new Parameter ("lname", TypeCode.String, "chand");
			view.InsertParameters.Add (p1);
			view.InsertParameters.Add (p2);
			view.InsertParameters.Add (p3);

			//This hashtable ovveride 
			Hashtable value = new Hashtable ();
			value.Add ("t", "test_id");

			//Merge parameters
			view.ExecuteInsert (value);
			Assert.AreEqual (true, MyTableObject.InsertWithMergedParameters, "InsertParametersCaseSensitive");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:25,代码来源:ObjectDataSourceTest.cs


示例2: ObjectDataSource_UpdateExecute_DataObjectTypeName

		public void ObjectDataSource_UpdateExecute_DataObjectTypeName ()
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			CustomObjectDataSourceView view = new CustomObjectDataSourceView (ods, "CustomView", null);
			view.TypeName = typeof (MyTableObject).AssemblyQualifiedName;
			view.DataObjectTypeName = typeof (NewData).AssemblyQualifiedName;
			
			view.SelectMethod = "GetMyData";
			view.UpdateMethod = "Update";
			view.OldValuesParameterFormatString = "oldvalue_{0}";
			view.ExecuteUpdate (null, null, null);
			Assert.AreEqual (true, MyTableObject.UpdateWithDataObjectTypeName, "UpdateExecute_DataObjectTypeName");
			Assert.AreEqual (", , ", MyTableObject.UpdatePassedValues, "UpdateExecute_DataObjectTypeName Values");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:15,代码来源:ObjectDataSourceTest.cs


示例3: ObjectDataSource_SelectExecuteCaseSensitive

		public void ObjectDataSource_SelectExecuteCaseSensitive ()
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			CustomObjectDataSourceView view = new CustomObjectDataSourceView (ods, "CustomView", null);
			view.SelectMethod = "GetMyData";
			view.TypeName = typeof (MyTableObject).AssemblyQualifiedName;
			view.SelectParameters.Add (new Parameter ("fname", TypeCode.String, "TestSelect"));
			ArrayList ls = (ArrayList) view.ExecuteSelect (new DataSourceSelectArguments (""));
			Assert.AreEqual ("TestSelect", ls[0], "SelectExecuteCaseSensitive");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:ObjectDataSourceTest.cs


示例4: ObjectDataSource_DeleteExecuteDataTypeCompareAllValues

		public void ObjectDataSource_DeleteExecuteDataTypeCompareAllValues () 
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			CustomObjectDataSourceView view = new CustomObjectDataSourceView (ods, "CustomView", null);
			view.TypeName = typeof (MyTableObject).AssemblyQualifiedName;
			view.DataObjectTypeName = typeof (NewData).AssemblyQualifiedName;
			view.SelectMethod = "GetMyData";
			view.DeleteMethod = "Delete";
			view.ConflictDetection = ConflictOptions.CompareAllValues;
			Hashtable keys;
			Hashtable old_value;
			Hashtable new_value;
			InitializeView (view, out keys, out old_value, out new_value);

			view.ExecuteDelete (keys, old_value);
			Assert.AreEqual (true, MyTableObject.DeleteWithDataObjectTypeName, "DeleteExecuteDataTypeCompareAllValues");
			Assert.AreEqual ("ov_1001, ov_Mahesh, ov_chand", MyTableObject.UpdatePassedValues, "DeleteExecuteDataTypeCompareAllValues Values");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:19,代码来源:ObjectDataSourceTest.cs


示例5: SelectMethodCached

		public static void SelectMethodCached (Page p)
		{
			MyTableObject.ds = MyTableObject.CreateDataTable ();
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			ods.EnableCaching = true;
			InitObjectDataSource (ods, "");
			p.Controls.Add (ods);
			ods.Selecting += new ObjectDataSourceSelectingEventHandler (odc_Selecting);

			selecting = false;
			IEnumerable table = (IEnumerable) ods.Select ();
			Assert.AreEqual (true, selecting, "AfterSelectingEvent");

			selecting = false;
			IEnumerable table2 = (IEnumerable) ods.Select ();
			Assert.AreEqual (false, selecting, "AfterSelectingEvent");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:17,代码来源:ObjectDataSourceTest.cs


示例6: UpdateMethod

		public static void UpdateMethod (Page p)
		{
			MyTableObject.ds = MyTableObject.CreateDataTable ();  
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "update");
			ods.Updated += new ObjectDataSourceStatusEventHandler (odc_Updated);
			ods.Updating += new ObjectDataSourceMethodEventHandler (odc_Updating);
			p.Controls.Add (ods);
			Assert.AreEqual (3, ((DataView) ods.Select ()).Count, "BeforeUpdate1");
			Assert.AreEqual (1001, ((DataView) ods.Select ())[0].Row.ItemArray[0], "BeforeUpdate2");
			Assert.AreEqual ("Mahesh", ((DataView) ods.Select ())[0].Row.ItemArray[1], "BeforeUpdate3");
			Assert.AreEqual ("Chand", ((DataView) ods.Select ())[0].Row.ItemArray[2], "BeforeUpdate4");
			Assert.AreEqual (false, updated, "BeforeUpdateEvent");
			Assert.AreEqual (false, updating, "BeforeUpdatingEvent");
			ods.Update ();
			Assert.AreEqual (3, ((DataView) ods.Select ()).Count, "AfterUpdate1");
			Assert.AreEqual (1001, ((DataView) ods.Select ())[0].Row.ItemArray[0], "AfterUpdate2");
			Assert.AreEqual ("David", ((DataView) ods.Select ())[0].Row.ItemArray[1], "AfterUpdate3");
			Assert.AreEqual ("Eli", ((DataView) ods.Select ())[0].Row.ItemArray[2], "AfterUpdate4");
			Assert.AreEqual (true, updated, "AfterUpdateEvent");
			Assert.AreEqual (true, updating, "AfterUpdatingEvent");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:22,代码来源:ObjectDataSourceTest.cs


示例7: EnableCachingException

		public static void EnableCachingException (Page p)
		{
			MyTableObject.ds = MyTableObject.CreateDataTable ();
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			ods.SelectMethod = "SelectException";
			ods.EnableCaching = true;			
			p.Controls.Add (ods);			
			IEnumerable table = (IEnumerable) ods.Select ();
			
		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:ObjectDataSourceTest.cs


示例8: DeleteMethod

		public static void DeleteMethod (Page p)
		{
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
			MyTableObject.ds = MyTableObject.CreateDataTable ();  
			DetailsView dv = new DetailsView ();
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			ods.Deleted += new ObjectDataSourceStatusEventHandler (odc_Deleted);
			ods.Deleting += new ObjectDataSourceMethodEventHandler (odc_Deleting);	
			InitObjectDataSource (ods,"");
			dv.Page = p;
			ods.Page = p;
			dv.DataKeyNames = new string[] { "ID" };
			dv.DataSource = ods;
			p.Controls.Add (lcb); 
			p.Controls.Add (ods);
			p.Controls.Add (dv);
			p.Controls.Add (lce); 
			dv.DataBind ();
			Assert.AreEqual (3, dv.DataItemCount, "BeforeDelete1");
			Assert.AreEqual (1001, dv.SelectedValue, "BeforeDelete2");
			Assert.AreEqual (false, deleting, "BeforeDeletingEvent");
			Assert.AreEqual (false, deleted, "BeforeDeletedEvent");
			ods.Delete ();			
			dv.DataBind ();
			Assert.AreEqual (true, deleting, "AfterDeletingEvent");
			Assert.AreEqual (true, deleted, "AfterDeletedEvent");
			Assert.AreEqual (2, dv.DataItemCount, "BeforeDelete1");
			Assert.AreEqual (1002, dv.SelectedValue, "BeforeDelete2");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:30,代码来源:ObjectDataSourceTest.cs


示例9: ObjectDataSource_DeleteExecuteMethodParameterException

		public void ObjectDataSource_DeleteExecuteMethodParameterException()
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			CustomObjectDataSourceView view = new CustomObjectDataSourceView (ods, "CustomView", null);
			view.TypeName = typeof (MyTableObject).AssemblyQualifiedName;
			view.SelectMethod = "GetMyData";
			view.DeleteMethod = "delete";
			Parameter p1, p2, p3;
			p1 = new Parameter ("ID", TypeCode.String, "1001");
			view.DeleteParameters.Add (p1);
			view.OldValuesParameterFormatString = "oldvalue_{0}";
			Hashtable value = new Hashtable ();
			value.Add ("ID", "test_id");
			view.ExecuteDelete (value, null);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:16,代码来源:ObjectDataSourceTest.cs


示例10: ObjectDataSource_SelectExecuteException_2

		public void ObjectDataSource_SelectExecuteException_2 ()
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			CustomObjectDataSourceView view = new CustomObjectDataSourceView (ods, "CustomView", null);
			view.SelectMethod = "Fake";
			view.TypeName = typeof (MyTableObject).AssemblyQualifiedName;
			view.SelectParameters.Add (new Parameter ("Fname", TypeCode.String, "TestSelect"));
			IEnumerable res = view.ExecuteSelect (new DataSourceSelectArguments (""));
		}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:ObjectDataSourceTest.cs


示例11: ObjectDataSource_UpdateExecute_CompareAllValues_Exception

		public void ObjectDataSource_UpdateExecute_CompareAllValues_Exception ()
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			CustomObjectDataSourceView view = new CustomObjectDataSourceView (ods, "CustomView", null);
			view.TypeName = typeof (MyTableObject).AssemblyQualifiedName;
			view.SelectMethod = "GetMyData";
			view.UpdateMethod = "TryUpdate_1";
			Parameter p1, p2, p3;
			p1 = new Parameter ("ID", TypeCode.String, "1001");
			p2 = new Parameter ("FName", TypeCode.String, "Mahesh");
			p3 = new Parameter ("LName", TypeCode.String, "chand");
			view.UpdateParameters.Add (p1);
			view.UpdateParameters.Add (p2);
			view.UpdateParameters.Add (p3);

			view.OldValuesParameterFormatString = "oldvalue_{0}";
			view.ConflictDetection = ConflictOptions.CompareAllValues;
			view.ExecuteUpdate (null, null, null);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:20,代码来源:ObjectDataSourceTest.cs


示例12: ObjectDataSource_DataSourceChanged

		public void ObjectDataSource_DataSourceChanged ()
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			((IDataSource) ods).DataSourceChanged += new EventHandler (ObjectDataSourceTest_DataSourceChanged);
			
			// Check if event raised
			ods.DoRaiseDataSourceChangedEvent ();
			Assert.IsTrue (eventChecker, "DataSourceChanged#1");

			eventChecker = false;
			ods.ConflictDetection = ConflictOptions.CompareAllValues;
			Assert.IsFalse (eventChecker, "DataSourceChanged#2");

			eventChecker = false;
			ods.DataObjectTypeName = "MyData";
			Assert.IsFalse (eventChecker, "DataSourceChanged#3");

			eventChecker = false;
			ods.EnablePaging = true;
			Assert.IsFalse (eventChecker, "DataSourceChanged#4");

			eventChecker = false;
			ods.FilterExpression = "ID='{0}'";
			Assert.IsFalse (eventChecker, "DataSourceChanged#5");


			eventChecker = false;
			TextBox TextBox1 = new TextBox ();
			TextBox1.Text = "1001";
			FormParameter p = new FormParameter ("ID", "TextBox1");
			p.DefaultValue = "1002";
			ods.FilterParameters.Add (p);
			Assert.IsFalse (eventChecker, "DataSourceChanged#6");

			eventChecker = false;
			ods.MaximumRowsParameterName = "SelectCount";
			Assert.IsFalse (eventChecker, "DataSourceChanged#7");

			eventChecker = false;
			ods.OldValuesParameterFormatString = "ID";
			Assert.IsFalse (eventChecker, "DataSourceChanged#8");

			eventChecker = false;
			Parameter dummy = new Parameter ();
			dummy.Name = "Test";
			ods.SelectParameters.Add (dummy);
			Assert.IsFalse (eventChecker, "DataSourceChanged#9");

			eventChecker = false;
			ods.SortParameterName = "sortExpression";
			Assert.IsFalse (eventChecker, "DataSourceChanged#10");

			eventChecker = false;
			ods.StartRowIndexParameterName = "ID";
			Assert.IsFalse (eventChecker, "DataSourceChanged#11");

			eventChecker = false; 
			ods.CacheDuration = 1000;
			Assert.IsFalse (eventChecker, "DataSourceChanged#12");

			eventChecker = false;
			ods.CacheExpirationPolicy = DataSourceCacheExpiry.Sliding;
			Assert.IsFalse (eventChecker, "DataSourceChanged#13");

			eventChecker = false;
			ods.CacheKeyDependency = "ID";
			Assert.IsFalse (eventChecker, "DataSourceChanged#14");

			eventChecker = false;
			ods.ConvertNullToDBNull = true;
			Assert.IsFalse (eventChecker, "DataSourceChanged#15");

			eventChecker = false;
			ods.EnableCaching = true;
			Assert.IsFalse (eventChecker, "DataSourceChanged#16");

			eventChecker = false;
			ods.SqlCacheDependency = "Northwind:Employees";
			Assert.IsFalse (eventChecker, "DataSourceChanged#17");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:81,代码来源:ObjectDataSourceTest.cs


示例13: ObjectDataSource_UpdateExecute_DataObjectTypeName2

		public void ObjectDataSource_UpdateExecute_DataObjectTypeName2 () 
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			CustomObjectDataSourceView view = new CustomObjectDataSourceView (ods, "CustomView", null);
			view.TypeName = typeof (MyTableObject).AssemblyQualifiedName;
			view.DataObjectTypeName = typeof (NewData).AssemblyQualifiedName;

			view.SelectMethod = "GetMyData";
			view.UpdateMethod = "Update";
			view.OldValuesParameterFormatString = "oldvalue_{0}";
			view.ConflictDetection = ConflictOptions.OverwriteChanges;
			Hashtable keys;
			Hashtable old_value;
			Hashtable new_value;
			InitializeView (view, out keys, out old_value, out new_value);

			view.ExecuteUpdate (keys, new_value, old_value);
			Assert.AreEqual (true, MyTableObject.UpdateWithDataObjectTypeName, "UpdateExecute_DataObjectTypeName2");
			Assert.AreEqual ("n_1001, n_Mahesh, n_chand", MyTableObject.UpdatePassedValues, "UpdateExecute_DataObjectTypeName Values");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:21,代码来源:ObjectDataSourceTest.cs


示例14: FilterParameter

		public static void FilterParameter (Page p)
		{
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
			DataGrid dg = new DataGrid ();
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			ods.FilterExpression = "{0}";
			Parameter p1 = new Parameter ("ID", TypeCode.String, "ID=1003");
			ods.FilterParameters.Add (p1); 
			p.Controls.Add (lcb);
			p.Controls.Add (dg);
			p.Controls.Add (ods);
			p.Controls.Add (lce);
			dg.DataSource = ods;
			dg.DataBind ();

		}
开发者ID:Profit0004,项目名称:mono,代码行数:18,代码来源:ObjectDataSourceTest.cs


示例15: FilterExpressionException

		public static void FilterExpressionException (Page p)
		{
			MyTableObject.ds = MyTableObject.CreateDataTable ();
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods, "");
			ods.SelectMethod = "SelectException";
			ods.FilterExpression  = "ID='1001'";
			p.Controls.Add (ods);
			IEnumerable table = (IEnumerable) ods.Select ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:ObjectDataSourceTest.cs


示例16: EnablePaging

		public static void EnablePaging (Page p)
		{
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
			GridView  gv = new GridView ();
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			ods.ID = "ObjectDataSource1";
			ods.TypeName = typeof (MyTableObject).AssemblyQualifiedName;
			ods.SelectMethod = "SelectForPaging";
			ods.EnablePaging = true;
			ods.SelectCountMethod = "SelectCount";
			ods.MaximumRowsParameterName = "maxRows";
			ods.StartRowIndexParameterName = "startIndex";
			gv.AllowPaging = true;
			gv.PageSize = 5;
			p.Controls.Add (lcb);
			p.Controls.Add (gv);
			p.Controls.Add (ods);
			p.Controls.Add (lce);
			gv.DataSourceID = "ObjectDataSource1";
			gv.DataBind ();	

		}
开发者ID:Profit0004,项目名称:mono,代码行数:23,代码来源:ObjectDataSourceTest.cs


示例17: InitObjectDataSource

		public static void InitObjectDataSource (ObjectDataSourcePoker ds, string action)
		{
			Parameter p1, p2, p3;
			switch (action) {		
				
			case "insert":	p1 = new Parameter ("ID", TypeCode.String, "1004");
					p2 = new Parameter ("fname", TypeCode.String, "David");
					p3 = new Parameter ("LName", TypeCode.String, "Eli");
					break;
				
			case "update": 	p1 = new Parameter ("ID", TypeCode.String, "1001");
					p2 = new Parameter ("FName", TypeCode.String, "David");
					p3 = new Parameter ("LName", TypeCode.String, "Eli");
					break;
			case "DBNull":  p1 = new Parameter ("ID");
					p2 = new Parameter ("FName");
					p3 = new Parameter ("LName");
					break;
				
			default: 	p1 = new Parameter ("ID", TypeCode.String, "1001");
					p2 = new Parameter ("FName", TypeCode.String, "Mahesh");
					p3 = new Parameter ("LName", TypeCode.String, "chand");
					break;
				
			}
			ds.SelectMethod = "GetMyData";
			ds.DeleteMethod = "Delete";
			ds.InsertMethod = "Insert";
			ds.UpdateMethod = "Update";
			ds.SelectCountMethod = "SelectCount";
			ds.DeleteParameters.Add (p1);
			ds.DeleteParameters.Add (p2);
			ds.DeleteParameters.Add (p3);
			ds.InsertParameters.Add (p1);
			ds.InsertParameters.Add (p2);
			ds.InsertParameters.Add (p3);
			ds.UpdateParameters.Add (p1);
			ds.UpdateParameters.Add (p2);
			ds.UpdateParameters.Add (p3);
			ds.ID = "MyObject";
			ds.TypeName = typeof (MyTableObject).AssemblyQualifiedName;
										      

		}
开发者ID:Profit0004,项目名称:mono,代码行数:44,代码来源:ObjectDataSourceTest.cs


示例18: SelectMethod

		public static void SelectMethod (Page p)
		{
			MyTableObject.ds = MyTableObject.CreateDataTable ();  
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods,"");			
			ods.Selected += new ObjectDataSourceStatusEventHandler (odc_Selected);
			ods.Selecting += new ObjectDataSourceSelectingEventHandler (odc_Selecting);
			p.Controls.Add (ods);
			Assert.AreEqual (false, selecting, "BeforeSelectingEvent");
			Assert.AreEqual (false, selected, "BeforeSelectedEvent");			
			IEnumerable table = (IEnumerable) ods.Select ();
			Assert.AreEqual (3,((DataView) table).Count, "ItemsCount");
			Assert.AreEqual ("Mahesh", ((DataView) table)[0].Row.ItemArray[1], "FirstItemData");
			Assert.AreEqual (1002, ((DataView) table)[1].Row.ItemArray[0], "SecondItemData");
			Assert.AreEqual ("Bansal", ((DataView) table)[2].Row.ItemArray[2], "ThirdItemData");			
			Assert.AreEqual (true, selecting, "AfterSelectingEvent");
			Assert.AreEqual (true, selected, "AfterSelectedEvent");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:18,代码来源:ObjectDataSourceTest.cs


示例19: ObjectDataSource_DefaultProperties

		public void ObjectDataSource_DefaultProperties ()
		{
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			
			Assert.AreEqual (ConflictOptions.OverwriteChanges, ods.ConflictDetection, "ConflictDetection");			
			Assert.AreEqual ("",ods.DataObjectTypeName ,"DataObjectTypeName ");
			Assert.AreEqual ("", ods.DeleteMethod, "DeleteMethod");
			Assert.AreEqual (typeof(ParameterCollection),ods.DeleteParameters.GetType (),"DeleteParameters");			
			Assert.AreEqual (false, ods.EnablePaging, "EnablePaging ");
			Assert.AreEqual ("", ods.FilterExpression, "FilterExpression ");
			Assert.AreEqual (typeof (ParameterCollection), ods.FilterParameters.GetType (), "FilterParameters");
			Assert.AreEqual ("", ods.InsertMethod, "InsertMethod ");
			Assert.AreEqual (typeof (ParameterCollection), ods.InsertParameters.GetType (), "InsertParameters ");
			Assert.AreEqual ("maximumRows", ods.MaximumRowsParameterName, "MaximumRowsParameterName");
			Assert.AreEqual ("{0}", ods.OldValuesParameterFormatString, "OldValuesParameterFormatString");
			Assert.AreEqual ("", ods.SelectCountMethod, "SelectCountMethod");
			Assert.AreEqual ("", ods.SelectMethod, "SelectMethod ");
			Assert.AreEqual (typeof (ParameterCollection), ods.SelectParameters.GetType (), "SelectParameters");
			Assert.AreEqual ("", ods.SortParameterName, "SortParameterName");			
			Assert.AreEqual ("startRowIndex", ods.StartRowIndexParameterName, "StartRowIndexParameterName");
			Assert.AreEqual ("", ods.TypeName, "TypeName");
			Assert.AreEqual ("", ods.UpdateMethod, "UpdateMethod ");
			Assert.AreEqual (typeof (ParameterCollection), ods.UpdateParameters.GetType (), "UpdateParameters");
			Assert.AreEqual (0, ods.CacheDuration, "CacheDuration");
			Assert.AreEqual (DataSourceCacheExpiry.Absolute, ods.CacheExpirationPolicy, "CacheExpirationPolicy");
			Assert.AreEqual ("", ods.CacheKeyDependency, "CacheKeyDependency");
			Assert.AreEqual (false, ods.ConvertNullToDBNull, "ConvertNullToDBNull ");
			Assert.AreEqual (false, ods.EnableCaching, "EnableCaching ");
			Assert.AreEqual ("", ods.SqlCacheDependency, "SqlCacheDependency");
			
		}
开发者ID:Profit0004,项目名称:mono,代码行数:31,代码来源:ObjectDataSourceTest.cs


示例20: InsertMethod

		public static void InsertMethod (Page p)
		{
			MyTableObject.ds = MyTableObject.CreateDataTable ();  
			ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
			InitObjectDataSource (ods,"insert");
			ods.Inserted += new ObjectDataSourceStatusEventHandler (odc_Inserted);
			ods.Inserting += new ObjectDataSourceMethodEventHandler (odc_Inserting);
			p.Controls.Add (ods);			
			Assert.AreEqual (3, ((DataView) ods.Select ()).Count, "BeforeInsert");
			Assert.AreEqual (false, inserted , "BeforeInsertedEvent");
			Assert.AreEqual (false, inserting , "BeforeInsertingEvent");
			ods.Insert ();		
			Assert.AreEqual (4, ((DataView) ods.Select ()).Count , "AfterInsert1");
			Assert.AreEqual (1004,((DataView) ods.Select ())[3].Row.ItemArray[0], "AfterInsert2");
			Assert.AreEqual ("David", ((DataView) ods.Select ())[3].Row.ItemArray[1], "AfterInsert3");
			Assert.AreEqual (true, inserted, "AfterInsertedEvent");
			Assert.AreEqual (true, inserting, "AfterInsertingEvent");
			
		}
开发者ID:Profit0004,项目名称:mono,代码行数:19,代码来源:ObjectDataSourceTest.cs



注:本文中的MonoTests.System.Web.UI.WebControls.ObjectDataSourcePoker类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.PokerGridView类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.ListViewPoker类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap