Solved

convert VB.NET to C#

Posted on 2011-03-19
4
222 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
Comment Utility
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
Comment Utility
Maybe something like this:

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

Author Comment

by:llj45
Comment Utility
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
Comment Utility
thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now