Posts

Showing posts from January, 2015

methods in c#

1> value parameter  using System; using System.Collections.Generic; using System.Linq; using System.Text; non static methond >  namespace Cshap {     class Program     {         static void Main(string[] args)         {             int i = 0;             int j = 0;             Program p = new Program();             p.simplemethod(j); //calling to simplemethod by passing value 1             Console.WriteLine(i); //3             Console.WriteLine(j);//4             Console.Read();         }         public  int  simplemethod(int j) //call it then folow goes to the static method 2         {        ...

If statement in c#

using System; class Program {     static void Main(string[] args)     {        Console.WriteLine("Please enter your lucky number");        int usernumber = Int32.Parse(Console.ReadLine());//Console.readline() return stringtype        if ((usernumber == 5) || (usernumber == 10)) //If this statement is true        {            //then-statement;            Console.WriteLine("You are lucky winner");        }        else        {            Console.WriteLine("!oops you lost a game");        }         Console.Read();                     }         } o/P depends upon the user input. using System; class Progra...

How to read value from the user in c#

Here we are using place holder syntax for the printing name in the console applicaion It is an array form,we can use many or several entry print at a single time. Console.ReadLine :  Read string from console Reads the next line of characters from the standard input stream. Exception: System. IOException System. OutOfMemoryException System . ArgumentOutOfRangeException using System; class Program {     static void Main(string[] args)     {         Console.WriteLine("Please enter your first name");         string FirstName = Console.ReadLine();//It return type is string         Console.WriteLine("Please enter your first name");         string Surname = Console.ReadLine();//It return type is string         Console.WriteLine("Hello" + FirstName); //"Hello" =static,FirstName=Dynamic         Console.WriteLine(Surname); ...

Name space in #

1. It is a collection of variety of classes in a arranged manner. 2.A name space is used to organize your code and is collection of various classes ,interface,collection,enums,delefates etc. System   is a namespace and  Console  is a class in that namespace. The  using  keyword can be used so that the complete name is not required, as in the following example: using System; //We are using system name space. //inside system namespace we have to describle console classess class Program {     static void Main()//static Main method     {         Console.WriteLine("Hello My dear Friends");         Console.Read();//Hold the screen     } } O/p Hello My dear Friends //Here we are not using 'using' name space class Program {     static void Main()//static Main method     {         System.Console.WriteLine("Hello My dear Friends"); ...

C# Tutorial - Introduction

SQL Important programing

Image
we have two table table jobs and journey details and jobid are common in both the table means jobs id are multiples time in the journey details jobid=1,jobid=1,jobid=1, and we are try to fetching data on the basis of departmentid on the both table so that we will get the data or multiples job present in the journey details table .Please check the given picture so that you will easily understand the whole scenario :) !> create two table Insert data into the tables