473,406 Members | 2,336 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,406 software developers and data experts.

Is there any statement in C# similar to With..End With in VB.NET

I am learning C#. I hav a few questions. Can anyone help me out?

Question 1:
I would like to know is there is any similar statement to the statement starting with WITH.. END WITH in VB.NET. For example, if i hav a textbox named TextBox1 on the form, I have to repeatedly type TextBox1 in each line in C#.NET when I work with its several properties. Is there an easy way?

Question 2:
Also I would like to know how can I implement vb scripts in a C#.NET desktop application.

Question 3:
The following piece of code produces compile error in C#.NET. Is there any way to make the compiler ignore this error without using the statement Convert.
string s = "123";
i = s; //compiler produces error!!

or

int i = 5;
textBox1.Text = i; //compiler produces error here also!!

Thanks in advance,

Sajan M.P
Sep 17 '07 #1
2 1145
r035198x
13,262 8TB
I am learning C#. I hav a few questions. Can anyone help me out?

Question 1:
I would like to know is there is any similar statement to the statement starting with WITH.. END WITH in VB.NET. For example, if i hav a textbox named TextBox1 on the form, I have to repeatedly type TextBox1 in each line in C#.NET when I work with its several properties. Is there an easy way?

Question 2:
Also I would like to know how can I implement vb scripts in a C#.NET desktop application.

Question 3:
The following piece of code produces compile error in C#.NET. Is there any way to make the compiler ignore this error without using the statement Convert.
string s = "123";
i = s; //compiler produces error!!

or

int i = 5;
textBox1.Text = i; //compiler produces error here also!!

Thanks in advance,

Sajan M.P
Have you tried some tutorials for these?
I've often found that reading can give me quite a bit of information for some things ...
Sep 17 '07 #2
kenobewan
4,871 Expert 4TB
I agree - try the tutorials, take a course or read book. We assume the basics here because of the technical nature of the forum. While have sympathy for those just starting, you'll get more at that stages by learning the basics. I am closing this thread.

MODERATOR
Sep 17 '07 #3

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

Similar topics

26
by: Joe Stevenson | last post by:
Hi all, I skimmed through the docs for Python, and I did not find anything like a case or switch statement. I assume there is one and that I just missed it. Can someone please point me to the...
35
by: Thomas Matthews | last post by:
Hi, My son is writing a program to move a character. He is using the numbers on the keypad to indicate the direction of movement: 7 8 9 4 5 6 1 2 3 Each number has a direction except...
6
by: ryan.mclean | last post by:
Hi all, first, let me preface this by saying that I am very new to sql server, coming from oracle. Here is my problem: I would like to have a case statement (similar to decode in oracle) that...
6
by: David | last post by:
I am using ADO to run some SQL statements in Access. First, I run query to create a table using SELECT . . . INTO Table A. Then, I run a query to SELECT . . . FROM Table A to get some data and...
11
by: Scott C. Reynolds | last post by:
In VB6 you could do a SELECT CASE that would evaluate each case for truth and execute those statements, such as: SELECT CASE True case x > y: dosomestuff() case x = 5: dosomestuff() case y >...
10
by: John Smith | last post by:
Can you do a Select Statement within a Select Statement? I want to build a query similar to queries built in Access which link to other queries but using only SQL Statements. Is it possible? If...
5
by: Andreas Müller | last post by:
Hi, I was wondering, if there is something similar in VB.NET like the using statement in C#. What it does is to automatically call Dispose on the object decrared with in the statement when the...
33
by: =?Utf-8?B?RE9UTkVUR1VZ?= | last post by:
Hello, In vb.net there is a with statement, Is there are similar constructor in c#?
2
by: Phillip B Oldham | last post by:
What would be the optimal/pythonic way to subject an object to a number of tests (based on the object's attributes) and redirect program flow? Say I had the following: pets = {'name':...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
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...
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:
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
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.