Click here to Skip to main content
15,923,087 members
Home / Discussions / Database
   

Database

 
AnswerRe: Timeout Expired The timeout period elapsed prior to completion Pin
OMalleyW9-Sep-05 6:48
OMalleyW9-Sep-05 6:48 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
miah alom9-Sep-05 7:04
miah alom9-Sep-05 7:04 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
OMalleyW9-Sep-05 7:34
OMalleyW9-Sep-05 7:34 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
miah alom9-Sep-05 7:56
miah alom9-Sep-05 7:56 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
Jaffer Mumtaz11-Sep-05 19:41
Jaffer Mumtaz11-Sep-05 19:41 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
OMalleyW12-Sep-05 6:32
OMalleyW12-Sep-05 6:32 
GeneralRe: Timeout Expired The timeout period elapsed prior to completion Pin
Andy Brummer12-Sep-05 8:27
sitebuilderAndy Brummer12-Sep-05 8:27 
QuestionDataRow Deletion Error.Please Help Me ! Pin
User 20930738-Sep-05 21:10
User 20930738-Sep-05 21:10 
Hi everybody !
I have a marvelous problem in deletion of a DataRow from a dataset table.I want my application to delete rows virtually.To aim that,I handeled the 'RowDeleted' event of the DataTable and in that event handler set the "Deleted" column of row (A bit column in SQLServer) to 1 and reject the changes of row to avoidance of row deletion after Updating the dataset to database.(I don't want the rows be deleted REALLY for undo capability of deletions).

See the code :

<code>
this.dataSet.Tables["tablename"].RowDeleted += new DataRowChangeEventHandle(RowDeleted);

//Event Handler
private void RowDeleted(object sender, DataRowChangeEventArgs e)
{			
	//To change the RowState from Deleted to Unchanged
	e.Row.RejectChanges();
	
	//e.Row.RowState is Deleted yet.This means
	//e.Row.RejectChanges(); is not worked truly			
			
	e.Row["Deleted"] = 1;
}


But when the 'e.Row.RejectChanges();' Executes I receive the following Exception :

System.Data.DeletedRowInaccessibleException : Deleted row information cannot be accessed through the row.
Wonderful thing is that when I replace the above code with the following code, everything is ok and the RowState is changed to UnChanged after Catch block !!!!
<code>

private void RowDeleted(object sender, DataRowChangeEventArgs e)
{			
	try
	{
	  e.Row.RejectChanges();			
	}
	catch{}
		
	//e.Row.RowState is Unchanged Here.This means
	//e.Row.RejectChanges(); is worked truly
	
	e.Row["Deleted"] = 1;
}


How can I do with this problem ?

Sorry for bad english.Thanx alot !

[ _ Always there is another way _ ]
AnswerRe: DataRow Deletion Error.Please Help Me ! Pin
miah alom9-Sep-05 6:00
miah alom9-Sep-05 6:00 
GeneralRe: DataRow Deletion Error.Please Help Me ! Pin
User 20930739-Sep-05 18:41
User 20930739-Sep-05 18:41 
GeneralRe: DataRow Deletion Error.Please Help Me ! Pin
miah alom12-Sep-05 8:57
miah alom12-Sep-05 8:57 
QuestionSql Enterprise Manager Pin
smita_roy8-Sep-05 19:49
smita_roy8-Sep-05 19:49 
AnswerRe: Sql Enterprise Manager Pin
Andy Brummer8-Sep-05 20:03
sitebuilderAndy Brummer8-Sep-05 20:03 
AnswerRe: Sql Enterprise Manager Pin
enjoycrack8-Sep-05 23:28
enjoycrack8-Sep-05 23:28 
AnswerRe: Sql Enterprise Manager Pin
miah alom9-Sep-05 7:54
miah alom9-Sep-05 7:54 
QuestionError with INSERT INTO Pin
°[Halo]°8-Sep-05 11:57
°[Halo]°8-Sep-05 11:57 
AnswerRe: Error with INSERT INTO Pin
Colin Angus Mackay8-Sep-05 12:22
Colin Angus Mackay8-Sep-05 12:22 
AnswerRe: Error with INSERT INTO Pin
enjoycrack8-Sep-05 21:14
enjoycrack8-Sep-05 21:14 
AnswerRe: Error with INSERT INTO Pin
Frank Kerrigan9-Sep-05 0:43
Frank Kerrigan9-Sep-05 0:43 
GeneralRe: Error with INSERT INTO Pin
miah alom9-Sep-05 5:41
miah alom9-Sep-05 5:41 
QuestionRe: Error with INSERT INTO Pin
°[Halo]°11-Sep-05 22:43
°[Halo]°11-Sep-05 22:43 
AnswerRe: Error with INSERT INTO Pin
QuietKnight13-Sep-05 11:16
QuietKnight13-Sep-05 11:16 
GeneralRe: Error with INSERT INTO Pin
QuietKnight13-Sep-05 11:18
QuietKnight13-Sep-05 11:18 
Questionabout SQL ... Pin
mostafa_h8-Sep-05 9:25
mostafa_h8-Sep-05 9:25 
AnswerRe: about SQL ... Pin
Colin Angus Mackay8-Sep-05 10:57
Colin Angus Mackay8-Sep-05 10:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.