dbDataAdapter and EditorBrowsable attribute

G

Greg Young

I found this while answerring a question yesterday .. I must be missing
something.

2.0
DbDataAdapter::Dispose()
..method public hidebysig newslot virtual final instance void Dispose() cil
managed
{
.custom instance void
[System]System.ComponentModel.EditorBrowsableAttribute::.ctor([System]System.ComponentModel.EditorBrowsableState)
= ( int32(0x00000001) )
.maxstack 2
L_0000: ldarg.0
L_0001: ldc.i4.1
L_0002: callvirt instance void
System.Data.Common.DbDataReader::Dispose(bool)
L_0007: ret
}

the value loded here is System.ComponentModel.EditorBrowsableState.Never.

What's interesting is that in VS 2005 it still shows up in intellisense for
me even though
it shouldn't per the documentation unless I am missing something somewhere
else
http://msdn2.microsoft.com/en-us/library/system.componentmodel.editorbrowsableattribute.aspx
Can't quite figure out why (I have even tried an example re-implementing the
interface as it does thinking that perhaps the re-implementation caused it).

---library assembly
public class Class1 : IAge{
int ageval;
[EditorBrowsable(EditorBrowsableState.Never)]
public int Age {
get { return ageval; }
set {
if (!ageval.Equals(value)) {
ageval = value;
}
}
}
}
public class Class2 : Class1, IAge {
}
public interface IAge {
int Age {
get;
}
}

--- main assembly
class Program {
static void Main(string[] args) {
Class2 f = new Class1();
//no f.age
}
}

But this still does not show up in intellisense so why is the
DbDataAdapter::Dispose showing up in intellisense even though it is
decorated to not show up?

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung
 
T

Tom Spink

Greg said:
I found this while answerring a question yesterday .. I must be missing
something.
<snipeddy-doo-dah>

Hi Greg,

I can't find the method DbDataAdapter::Dispose(). All I can find is a
protected DbDataAdapter::Dispose(bool) method... Any hints?
 
G

Greg Young

Sorry it is SqlDataReader .. then DbDataReader

Don't know why I got DataAdapter in my head when typing this.

Cheers,

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top