C Sharp

C Sharp

+ Follow 3,382 Followers


C Sharp Lessons

Read CSV data using ODBC Connection
Codes to read the CSV data using ODBC Connection- Input File: File's Encoding format should be ANSI as below class Student{ public string CollegeId { get; set; } public string AdmissionDate {...

Revan | 22 Mar

0 0
Tips of learning Java Language/Other Programming Languages
1.You should know the basic concept: If we talk about programming languages so basic concept are same in all the high level languages. So you should know the basic concept firstly then you can easily understand...
C#-Program Rectangle and Circle
using System;using System.Collections.Generic;using System.Linq;using System.Text; //Namespace declarationnamespace figures{ //Rectangle Class declaration class rectangle { // member variables...

Salim Ahmed | 18 Jan

1 0

Trending Discussions


What is a best book to learn c # language & asp.net

2 4

Show previous answers

Manoj Kumar Vishwakarma | 09/04/2016

perfect introduction to C# By PwPrins

Naveen Nn | 09/04/2016

Apress C# For Beginners


Show previous answers

Rakesh G | 12/03/2016

if you are beginner you can start with HeadFirst Labs books, they are good. Manning Publications books are excellent for intermediate level. But personally i recommend MSDN articles for authentic and more information. Each and every topic is will be explained very well.

Rakesh G | 12/03/2016

I can provide you the best training and learning experience. If you are interested let me know.


Show previous answers

Dinesh Joshi | 13/12/2015

Use System.Threading for Create threads.

Chandrashekar Achary | 14/01/2016

This example demonstrates how to create and start a thread, and shows the interaction between two threads running simultaneously within the same process. Note that you don't have to stop or free the thread. This is done automatically by the .NET Framework common language runtime. The program begins by creating an object of type Alpha (oAlpha) and a thread (oThread) that references the Beta method of the Alpha class. The thread is then started. The IsAlive property of the thread allows the program to wait until the thread is initialized (created, allocated, and so on). The main thread is accessed through Thread, and the Sleep method tells the thread to give up its time slice and stop executing for a certain amount of milliseconds. The oThread is then stopped and joined. Joining a thread makes the main thread wait for it to die or for a specified time to expire (for more details, see Thread.Join Method). Finally, the program attempts to restart oThread, but fails because a thread cannot be restarted after it is stopped (aborted). For information on temporary cessation of execution, see Suspending Thread Execution. public class Alpha { // This method that will be called when the thread is started public void Beta() { while (true) { Console.WriteLine("Alpha.Beta is running in its own thread."); } } }; public class Simple { public static int Main() { Console.WriteLine("Thread Start/Stop/Join Sample"); Alpha oAlpha = new Alpha(); // Create the thread object, passing in the Alpha.Beta method // via a ThreadStart delegate. This does not start the thread. Thread oThread = new Thread(new ThreadStart(oAlpha.Beta)); // Start the thread oThread.Start(); // Spin for a while waiting for the started thread to become // alive: while (!oThread.IsAlive); // Put the Main thread to sleep for 1 millisecond to allow oThread // to do some work: Thread.Sleep(1); // Request that oThread be stopped oThread.Abort(); // Wait until oThread finishes. Join also has overloads // that take a millisecond interval or a TimeSpan object. oThread.Join(); Console.WriteLine(); Console.WriteLine("Alpha.Beta has finished"); try { Console.WriteLine("Try to restart the Alpha.Beta thread"); oThread.Start(); } catch (ThreadStateException) { Console.Write("ThreadStateException trying to restart Alpha.Beta. "); Console.WriteLine("Expected since aborted threads cannot be restarted."); } return 0; } } Example Output Thread Start/Stop/Join Sample Alpha.Beta is running in its own thread. Alpha.Beta is running in its own thread. Alpha.Beta is running in its own thread. ... ... Alpha.Beta has finished Try to restart the Alpha.Beta thread ThreadStateException trying to restart Alpha.Beta. Expected since aborted threads cannot be restarted.

Thousands of experts Tutors, Trainers & other Professionals are available to answer your questions

Ask a Pro

Recommended for you

Have a Question?

Thousands of expert tutors are available to answer your question

Looking for C Sharp Classes?

Find best C Sharp Classes in your locality on UrbanPro.


Do you offer C Sharp Classes?

Create Free Profile Now »

Top Contributors

Manoj Kumar

2 Answers


2 Answers


1 Answer


1 Answer


1 Answer


1 Answer


1 Answer


1 Answer


1 Answer


About UrbanPro

UrbanPro.com helps you to connect with the best C Sharp Classes in India. Post Your Requirement today and get connected.

Find Best C Sharp Classes?

Find Now »