System.Data.DataSet.HasChanges C# (CSharp) Method

HasChanges() public method

Gets a value indicating whether the has changes, including new, deleted, or modified rows.
public HasChanges ( ) : bool
return bool
        public bool HasChanges() => HasChanges(DataRowState.Added | DataRowState.Deleted | DataRowState.Modified);

Same methods

DataSet::HasChanges ( DataRowState rowStates ) : bool

Usage Example

Beispiel #1
0
	//Activate This Construntor to log All To Standard output
	//public TestClass():base(true){}

	//Activate this constructor to log Failures to a log file
	//public TestClass(System.IO.TextWriter tw):base(tw, false){}


	//Activate this constructor to log All to a log file
	//public TestClass(System.IO.TextWriter tw):base(tw, true){}

	//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES

	public void run()
	{
		Exception exp = null;
	
		DataSet ds = new DataSet();
		ds.Tables.Add(GHTUtils.DataProvider.CreateParentDataTable());

		try
		{
			BeginCase("HasChanges 1");
			Compare(ds.HasChanges(),false );
		}
		catch(Exception ex)	{exp = ex;}
		finally	{EndCase(exp); exp = null;}
		
		DataRow dr = ds.Tables[0].NewRow();
		dr[0] = 9;
		ds.Tables[0].Rows.Add(dr);
		
		try
		{
			BeginCase("HasChanges 2");
			Compare(ds.HasChanges(),true );
		}
		catch(Exception ex)	{exp = ex;}
		finally	{EndCase(exp); exp = null;}
	}
All Usage Examples Of System.Data.DataSet::HasChanges