[Mono-devel-list] Couple of questions/ Issues in implementing System.Data

S Umadevi sUmadevi at novell.com
Mon Apr 12 06:58:31 EDT 2004

  I have been facing problems with implementing some of the
classes/methods in system.data.
Any pointers/answers to the below questions will be very helpful.

1.  Connection.EnlistDistributedTransaction method
. EnlistDistributedTransaction - This needs some change in
implementation in the existing System.Data.Common.Connection code
itself.  With the current MSDN documentation I am not very clear on how
to implement it.

2. RowUpdatedEventArgs.RecordsAffected 
 How do I get the RecordsAffected for theRowUpdatedEventArgs?

3. Generic question for testing many new method implementations.
 With the code for the  databaseproviders not changing for
changes/implementations done in system.data, how can I test the code in

4. Any class/method which needs to have ToolBoxItemAttribute as a
. Running Reflection on ToolbxItemAttribute for
SqlDataAdapter/SqlCommand is crashing on windows/net with the following


Unhandled Exception: System.ArgumentException: Failed to create
ToolboxItem of type: Microsoft.VSDes
igner.Data.VS.SqlDataAdapterToolboxItem, Microsoft.VSDesigner,
Version=7.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a ---> System.IO.FileNotFoundException:
File or assembly name Microsof
t.VSDesigner, or one of its dependencies, was not found.
File name: "Microsoft.VSDesigner"
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at System.ComponentModel.ToolboxItemAttribute.get_ToolboxItemType()

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.VSDesigner, Version=7.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7
LOG: Appbase = D:\UmaTest\bin\Debug\
LOG: Initial PrivatePath = NULL
Calling assembly : System, Version=1.0.5000.0, Culture=neutral,

LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
LOG: Post-policy reference: Microsoft.VSDesigner, Version=7.0.5000.0,
Culture=neutral, PublicKeyToke
LOG: Attempting download of new URL
LOG: Attempting download of new URL
LOG: Attempting download of new URL
LOG: Attempting download of new URL

   --- End of inner exception stack trace ---
   at System.ComponentModel.ToolboxItemAttribute.get_ToolboxItemType()
   at RegexError.Main() in d:\UmaTest\UmaTest\EmptyC#file.cs:line 122

5. DbDataPermissionAttribute.KeyRestriction.method
1. KeyRestriction in DbDataPermissionAttribute : The MSDN Documentation
One or more connection string parameters that are allowed or
Connection string parameters are identified in the form <parameter
name>=. Multiple parameters can be specified, delimited using a
semi-colon (;). The connection string parameters listed may be
identified as either the only additional parameters allowed or
additional parameters that are not allowed using the
KeyRestrictionBehavior property.

If no key restrictions are specified, and the KeyRestrictionBehavior
property is set to AllowOnly, then no additional connection string
parameters are allowed.

If no key restrictions are specified, and the KeyRestrictionBehavior
property is set to PreventUsage, then additional connection string
parameters are allowed. If more than one rule is set for the same
connection string, the more restrictive rule is selected during the
permission check.
When are these restrictions applied to the connection string for
additional parameters ?. Since the connectionstring is a string how do
we enforce  any additional parameters to it?  Or is that we dont want to
allow additional agruements?

Incase there are any examples of this usage please let me know..

6 SqlDataReader.HasRow method
.The HasRow method on SqlDataReader returns whether the DataReader has
one or more rows. But it DOES NOT read the Row. It is supposed to be
used as a mechanism to check whether Read can be called. (even though it
sounds redundant!)

Now to implement this,  I will need a mechanism to peek into the
TdsPacket/buffer  and still not read it into the currentRow object of
the Tds class in Mono.Tds.TdsProtocol. Because if we call a read
immediately, we need to read the CurrentRow.

This will involve significant code changes in
Mono.Data.Tds.Protocol.Tds.cs and Mono.Data.Tds.Protocol.TdsComm.cs.

This seems to  be the only way to achieve the above functionality..
Should I go ahead and make the changes or is there a better way to do
this ?

7. Copy/AddPermission to all Permission classes
Any pointers on how to implement these will be helpful.. This question
is tied to the Keyrestrictions answer too..


More information about the Mono-devel-list mailing list