By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,018 Members | 894 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,018 IT Pros & Developers. It's quick & easy.

Does Microsoft accept bug reports for their Application Blocks?

P: n/a
I ran into a maddening bug that I finally tracked down to Microsoft's Data
Access Blocks. It is in the SQL Helper UpdateDataSet method as follows:

Microsoft Code:

#region UpdateDataset
public static void UpdateDataset(SqlCommand insertCommand, SqlCommand
deleteCommand, SqlCommand updateCommand, DataSet dataSet, string tableName)
{
if( insertCommand == null ) throw new ArgumentNullException(
"insertCommand" );
if( deleteCommand == null ) throw new ArgumentNullException(
"deleteCommand" );
if( updateCommand == null ) throw new ArgumentNullException(
"updateCommand" );
if( tableName == null || tableName.Length == 0 ) throw new
ArgumentNullException( "tableName" );
// Create a SqlDataAdapter, and dispose of it after we are done
using (SqlDataAdapter dataAdapter = new SqlDataAdapter())
{
// Set the data adapter commands
dataAdapter.UpdateCommand = updateCommand;
dataAdapter.InsertCommand = insertCommand;
dataAdapter.DeleteCommand = deleteCommand;
// Update the dataset changes in the data source
dataAdapter.Update (dataSet, tableName);
// Commit all the changes made to the DataSet
dataSet.AcceptChanges(); // THIS IS A BUG!!!
}
}
#endregion

LAST LINE SHOULD BE:

dataSet.Tables[tableName].AcceptChanges();

The Microsoft version is committing changes to ALL tables in the dataset
prior to giving an opportuity to update the database with them. Return from
this metod shows their every table RowState as "Unchanged".
Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"BStorm" <nf*@nospam.com> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
I ran into a maddening bug that I finally tracked down to Microsoft's Data
Access Blocks. It is in the SQL Helper UpdateDataSet method as follows:


Report it in the GotDotNet (www.gotdotnet.com) workspace for the DAAB...
That would be where the people responsible might see it...

HTHs..

John
Nov 22 '05 #2

P: n/a
I've found a few as well. This one looks like it was a pain to track down =)

I'll try and ping someone with this, but let's not hold our breaths. I have
no idea who is in charge of these or what their release schedule is, if it
exists.

--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"BStorm" <nf*@nospam.com> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
I ran into a maddening bug that I finally tracked down to Microsoft's Data
Access Blocks. It is in the SQL Helper UpdateDataSet method as follows:

Microsoft Code:

#region UpdateDataset
public static void UpdateDataset(SqlCommand insertCommand, SqlCommand
deleteCommand, SqlCommand updateCommand, DataSet dataSet, string tableName) {
if( insertCommand == null ) throw new ArgumentNullException(
"insertCommand" );
if( deleteCommand == null ) throw new ArgumentNullException(
"deleteCommand" );
if( updateCommand == null ) throw new ArgumentNullException(
"updateCommand" );
if( tableName == null || tableName.Length == 0 ) throw new
ArgumentNullException( "tableName" );
// Create a SqlDataAdapter, and dispose of it after we are done
using (SqlDataAdapter dataAdapter = new SqlDataAdapter())
{
// Set the data adapter commands
dataAdapter.UpdateCommand = updateCommand;
dataAdapter.InsertCommand = insertCommand;
dataAdapter.DeleteCommand = deleteCommand;
// Update the dataset changes in the data source
dataAdapter.Update (dataSet, tableName);
// Commit all the changes made to the DataSet
dataSet.AcceptChanges(); // THIS IS A BUG!!!
}
}
#endregion

LAST LINE SHOULD BE:

dataSet.Tables[tableName].AcceptChanges();

The Microsoft version is committing changes to ALL tables in the dataset
prior to giving an opportuity to update the database with them. Return from this metod shows their every table RowState as "Unchanged".

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.