Hello Fellows,
Can you let me know how do i convert the below VB.NET piece of code into c#?
Dim targetTypes(0) as Type
targetTypes(0) = GetType(Order)
Thanks :) 4 1206
NewBie wrote: Hello Fellows,
Can you let me know how do i convert the below VB.NET piece of code into c#?
Dim targetTypes(0) as Type targetTypes(0) = GetType(Order)
Type[] targetTypes = new Type[1];
targetTypes[0] = GetType(Order);
FB, who wonders what this has to do with ADO.NET ;)
--
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
[raising hand and waving wildly]
I do! I do!
--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in message
news:xn***************@msnews.microsoft.com... NewBie wrote:
Hello Fellows,
Can you let me know how do i convert the below VB.NET piece of code into c#?
Dim targetTypes(0) as Type targetTypes(0) = GetType(Order)
Type[] targetTypes = new Type[1]; targetTypes[0] = GetType(Order);
FB, who wonders what this has to do with ADO.NET ;)
-- Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com My .NET Blog: http://weblogs.asp.net/fbouma Microsoft C# MVP
Hi FB,
Thanks for the reply, i had tried that but i get the below compilation error...
'NameSpace.Order' denotes a 'class' where a 'variable' was expected.
Then realised that get type takes in a string, (type name) in C#
BTW.. ADO.NET? i posted the Q in the NG "microsoft.public.dotnet.languages.csharp"
Tnx once again...
"Frans Bouma [C# MVP]" wrote: NewBie wrote:
Hello Fellows,
Can you let me know how do i convert the below VB.NET piece of code into c#?
Dim targetTypes(0) as Type targetTypes(0) = GetType(Order)
Type[] targetTypes = new Type[1]; targetTypes[0] = GetType(Order);
FB, who wonders what this has to do with ADO.NET ;)
-- Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com My .NET Blog: http://weblogs.asp.net/fbouma Microsoft C# MVP
The VB.NET GetType() function is called typeof() in C#
Your example then becomes:
Type[] targetTypes = new Type[1];
targetTypes[0] = typeof(Order);
or shorter:
Type[] targetTypes = new Type[] {typeof(Order)};
"NewBie" <Ne****@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com... Hi FB, Thanks for the reply, i had tried that but i get the below compilation
error... 'NameSpace.Order' denotes a 'class' where a 'variable' was expected. Then realised that get type takes in a string, (type name) in C#
BTW.. ADO.NET? i posted the Q in the NG
"microsoft.public.dotnet.languages.csharp" Tnx once again...
"Frans Bouma [C# MVP]" wrote:
NewBie wrote:
Hello Fellows,
Can you let me know how do i convert the below VB.NET piece of code
into c#? Dim targetTypes(0) as Type targetTypes(0) = GetType(Order)
Type[] targetTypes = new Type[1]; targetTypes[0] = GetType(Order);
FB, who wonders what this has to do with ADO.NET ;)
-- Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com My .NET Blog: http://weblogs.asp.net/fbouma Microsoft C# MVP This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rod Carrol |
last post by:
Hello all,
As a beginner I've been exeperiencing lots of errors while building my
website, (I'm currently attempting to implement a member
login/registration piece for my site using mySQL and...
|
by: David |
last post by:
Hello ,
I'm trying to parse an XML document a get spicific tags such as email in the
code below. I'm using xerces 2.4. However I don't manage to get the value
for the email. Can anybody help.
...
|
by: jacksonaaronc |
last post by:
Greetings,
I am in need of two things.
First, I need a list of good resources for someone that wishes to learn
XML. If there are any defacto books, URL, etc I would love to know
where to...
|
by: Alex |
last post by:
Hello
I am interested learn more about .NET but am uncertain of exactly what niche
it fills in the world of programming. (The more I read the more I am
confused).
What I am looking for is the...
|
by: Spam Me Please |
last post by:
I have a tree like this
struct BTree{
int left;
char c;
int right;
};
#define END -1
int main(int argc, char *argv)
|
by: Blaze |
last post by:
I am doing the first walk through on the Visual Studio .Net walkthrough book
to learn a little about programming. I am having issues with the first
tutorial not running correctly. It seems that...
|
by: Scott Schluer |
last post by:
Hello,
I'm fairly experience with VB.NET in so far as it's syntax is concerned,
however I'm coming from a web-based environment. Typically, when I want to
store data (i.e. user preferences,...
|
by: pepito3 |
last post by:
Hi. I have a question about PHP programming philosophy:
Imagine a web of a shop with a table displaying the name of some
products. There is a link "Buy" next to each product. I want that link
to...
|
by: ddg_linux |
last post by:
I have been reading about and doing a lot of php code examples from
books but now I find myself wanting to do something practical with
some of the skills that I have learned.
I am a beginner php...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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...
|
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| | |