473,395 Members | 1,488 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Reflection - method parameter marked as "out" doesn't have a BaseType

I've got some code that is trolling through and assembly looking for
methods that have parameters whose BaseType is DataSet (they are
strongly-typed DataSets). .ParameterType.BaseType is always DataSet
for parameters that are passed like:

MyMethod(MyStronglyTypedDataSet myDataSet);

.... but the BaseType is null for :

MyMethod(out MyStronglyTypedDataSet myDataSet);

Does anyone know why this is happening. How can I tell what the
BaseType this parameter is? T

Oct 25 '07 #1
2 1369
On Oct 25, 1:00 pm, timn...@gmail.com wrote:
I've got some code that is trolling through and assembly looking for
methods that have parameters whose BaseType is DataSet (they are
strongly-typed DataSets). .ParameterType.BaseType is always DataSet
for parameters that are passed like:

MyMethod(MyStronglyTypedDataSet myDataSet);

... but the BaseType is null for :

MyMethod(out MyStronglyTypedDataSet myDataSet);

Does anyone know why this is happening. How can I tell what the
BaseType this parameter is? T
Use Type.HasElementType/Type.GetElementType() to get the "non-out"
type, and then you can find the base type from that.

Jon

Oct 25 '07 #2
On Oct 25, 8:30 am, "Jon Skeet [C# MVP]" <sk...@pobox.comwrote:
On Oct 25, 1:00 pm, timn...@gmail.com wrote:
I've got some code that is trolling through and assembly looking for
methods that have parameters whose BaseType is DataSet (they are
strongly-typed DataSets). .ParameterType.BaseType is always DataSet
for parameters that are passed like:
MyMethod(MyStronglyTypedDataSet myDataSet);
... but the BaseType is null for :
MyMethod(out MyStronglyTypedDataSet myDataSet);
Does anyone know why this is happening. How can I tell what the
BaseType this parameter is? T

Use Type.HasElementType/Type.GetElementType() to get the "non-out"
type, and then you can find the base type from that.

Jon
Thanks Jon! That did the trick!

Oct 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: schears | last post by:
Why? Running on windows 2000 with all updates, 2G Memory, 117G Hard Drive space available. This was not an issue until I added some code to two of my c files. Any suggestions? Thanks
2
by: None | last post by:
If a method takes an "out int" as a parameter is it possible to not pass anything to that parameter? "null" and "out null" does not work.
1
by: Alex Chan | last post by:
Hi Group, I have written a window service wtih SAP.NET Connector which is to fulfil request from SAP client. SAP client will call a function exposed by my window service that has a big "out"...
11
by: John A Grandy | last post by:
asp.net 1.1 ie 6 how to lock-out the user from clicking the browser "Back" button ?
4
by: lawrence k | last post by:
I've a jpeg image that is 514k, which doesn't strike me as very large. Yet I'm running out of error when I try to resize it: Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to...
7
by: John Layton | last post by:
Hi there, Is it possible to pass null to a function taking an "out" (or "ref") parameter in C#. I'd like to do something like the following (which doesn't compile of course). Thanks in advance....
16
by: saurabhnsit2001 | last post by:
The following program doesn't "seem" to print "hello-out". (Try executing it) #include <stdio.h> #include <unistd.h> int main() { while(1) { fprintf(stdout,"hello-out");
1
by: Christoph | last post by:
I have a cmd file (batch file) which starts an exe after setting parameters. I need to find out the Process ID of the exe via a command. The problem is that my program, written in C# only knows the...
0
by: LieWait | last post by:
've got some code that is trolling through and assembly looking for methods that have parameters whose BaseType is DataSet (they are strongly-typed DataSets). .ParameterType.BaseType is always...
0
by: cfatulescu | last post by:
Hello, i'm trying to reproduce a method using Reflection.Emit, everything is going well except one small thing, without all my job is done for nothing. I can not reproduce the keyword...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.