Solved

convert VB.NET to C#

Posted on 2011-03-19
4
225 Views
Last Modified: 2012-05-11
Hi,
  Please convert this VB.NET code to C#.  Please try to keep the second line of code a single line of code.

Dim questionID As Integer
questionID = CType(Items.FindControl("lblQnum"), Label).Text

Thanks, LLJ45
0
Comment
Question by:llj45
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 35172466
int questionID = 0;
questionID = ((Label)Items.FindControl("lblQnum")).Text;

Try
http://www.developerfusion.com/tools/convert/vb-to-csharp/

Raj
0
 
LVL 2

Accepted Solution

by:
michael_madsen earned 500 total points
ID: 35172501
Maybe something like this:

int questionID;
questionID = int.Parse(((Label)FindControl("lblQnum")).Text);
0
 

Author Comment

by:llj45
ID: 35172504
Hi, Raj
  I already tried the developerfusion converter web site.  It doesn't work on this code.
  You can set up an example to see what I mean.
Thanks, LLJ45
0
 

Author Closing Comment

by:llj45
ID: 35172512
thanks!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question