Reputation: 263
I am trying to perform a batch update in a .NET console application using OdbcDataAdapter by setting UpdateBatchSize:
OdbcDataAdapter da = new OdbcDataAdapter();
da.UpdateBatchSize = 100;
Trying to set UpdateBatchsize property throws following error:
set_UpdateBatchSize(Int32 value) Specified method is not supported.
If I set the UpdateBatchsize value to 1, then it works fine. Does OdbcDataAdapter support batch updates?
Here is msdn link to perform batch updates with DataAdapter
Any help would be greatly appreciated.
Upvotes: 0
Views: 390
Reputation: 3868
Here is the decompiled code from the DbDataAdapter class:
public virtual int UpdateBatchSize
{
get
{
return 1;
}
set
{
if (1 != value)
throw ADP.NotSupported();
}
}
The OdbcDataAdapter class does not override it. SqlDataAdapter does this. So, you may conclude that this feature is not supported in OdbcDataAdapter.
Upvotes: 3