Click here to Skip to main content
15,921,530 members
Home / Discussions / C#
   

C#

 
GeneralRe: SQL Database Connection Pin
Darkness8421-Mar-07 18:40
Darkness8421-Mar-07 18:40 
GeneralRe: SQL Database Connection Pin
coolestCoder21-Mar-07 19:15
coolestCoder21-Mar-07 19:15 
GeneralRe: SQL Database Connection Pin
Darkness8421-Mar-07 19:20
Darkness8421-Mar-07 19:20 
QuestionRe: Calculate and Display Prime Numbers Pin
chitra4sat21-Mar-07 18:05
chitra4sat21-Mar-07 18:05 
AnswerRe: Calculate and Display Prime Numbers Pin
sherifffruitfly21-Mar-07 18:11
sherifffruitfly21-Mar-07 18:11 
AnswerRe: Calculate and Display Prime Numbers Pin
Leslie Sanford21-Mar-07 18:33
Leslie Sanford21-Mar-07 18:33 
GeneralRe: Calculate and Display Prime Numbers Pin
chitra4sat21-Mar-07 19:27
chitra4sat21-Mar-07 19:27 
GeneralRe: Calculate and Display Prime Numbers Pin
Leslie Sanford21-Mar-07 19:37
Leslie Sanford21-Mar-07 19:37 
chitra4sat wrote:
Here everything is in Main Program itself. But i want it all in a seperate class Nmaed PrimeNumClass.cs and i have to call that class in the main Class to display the output.


Creating a new class is easy. Just right click on your project and click on Add then Class from the pop menu. Fill in the text box with the name of your of your class, in this case, PrimeNumClass.

The IDE will create a source file for you that looks like this:

using System;
using System.Collections.Generic;
using System.Text;
 
namespace PrimeNumber
{
    class PrimeNumClass
    {
    }
}


Now, once you get to this point, you need to add a method to the class that contains your prime number algorithm. In this case, it would probably be best to make the method static. Also, make sure that it has public access so that it can be called from your Main function.

I'm going to leave it here and let you take over. If you have any problems, feel free to ask.
GeneralRe: Calculate and Display Prime Numbers Pin
chitra4sat21-Mar-07 19:48
chitra4sat21-Mar-07 19:48 
GeneralRe: Calculate and Display Prime Numbers Pin
Leslie Sanford21-Mar-07 20:00
Leslie Sanford21-Mar-07 20:00 
QuestionC# Automation Addin for Excel using ,NET - Build Error - Cannot Register Assembly (MSB3217) Pin
ralph_y21-Mar-07 17:58
ralph_y21-Mar-07 17:58 
QuestionHow to remove the rectangle from Propertygrid ? Pin
TaiZhong21-Mar-07 17:03
TaiZhong21-Mar-07 17:03 
AnswerRe: How to remove the rectangle from Propertygrid ? Pin
visualhint16-Apr-07 3:33
visualhint16-Apr-07 3:33 
Questionblock website function by enterring in texbox in a form.need help here Pin
krajah1021-Mar-07 15:26
krajah1021-Mar-07 15:26 
Questionthread question Pin
dino209421-Mar-07 14:51
dino209421-Mar-07 14:51 
AnswerRe: thread question Pin
Leslie Sanford21-Mar-07 17:02
Leslie Sanford21-Mar-07 17:02 
QuestionProgram structure need experienced programmers perspective please Pin
Mischievious21-Mar-07 14:36
Mischievious21-Mar-07 14:36 
AnswerRe: Program structure need experienced programmers perspective please Pin
Leslie Sanford21-Mar-07 17:05
Leslie Sanford21-Mar-07 17:05 
GeneralRe: Program structure need experienced programmers perspective please Pin
Mischievious21-Mar-07 18:14
Mischievious21-Mar-07 18:14 
QuestionQuestion about Windows Media Encoder Pin
Julianne_juju21-Mar-07 14:11
Julianne_juju21-Mar-07 14:11 
QuestionNeed help with XML config file Pin
Mark F.21-Mar-07 13:40
Mark F.21-Mar-07 13:40 
AnswerRe: Need help with XML config file Pin
coolestCoder21-Mar-07 18:31
coolestCoder21-Mar-07 18:31 
QuestionTrouble converting byte[] to bmp..... Pin
Are Jay21-Mar-07 12:17
Are Jay21-Mar-07 12:17 
AnswerRe: Trouble converting byte[] to bmp..... Pin
Nick Hodapp21-Mar-07 12:44
sitebuilderNick Hodapp21-Mar-07 12:44 
GeneralRe: Trouble converting byte[] to bmp..... Pin
Are Jay22-Mar-07 3:23
Are Jay22-Mar-07 3:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.