Tuesday, 13 November 2012

c sharp classes

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StringManipulationPost
{
    class Program
    {
        static void Main(string[] args)
        {
          
            string string1 = "hello";
       string string2 = "good bye";
       string string3 = "Happy Birthday";
       string string4 = "happy birthday";

       Console.WriteLine( "string1 = \"" + string1 + "\"" +
          "\nstring2 = \"" + string2 + "\"" +
         "\nstring3 = \"" + string3 + "\"" +
          "\nstring4 = \"" + string4 + "\"\n" );

       // test for equality using Equals method
       if ( string1.Equals( "hello" )  )
         Console.WriteLine( "string1 equals \"hello\"" );
      else
          Console.WriteLine( "string1 does not equal \"hello\"" );

      // test for equality with ==
     if ( string1 == "hello" )
        Console.WriteLine( "string1 equals \"hello\"" );
       else
          Console.WriteLine( "string1 does not equal \"hello\"" );
            // test for equality comparing case
       if ( string.Equals( string3, string4 )  ) // static method
         Console.WriteLine( "string3 equals string4" );
       else
          Console.WriteLine( "string3 does not equal string4" );


string1.Equals( "hello" );
//string1 == "hello";
string.Equals( string3, string4 );



Console.ReadLine();


 
        }
    }
}

c# for dummies: c sharp programming

c# for dummies: c sharp programming: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace StringManipulationPost {     class Program  ...

c sharp programming

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StringManipulationPost
{
    class Program
    {
        static void Main(string[] args)
        {
          
           string string1 = "hello there";
        char[] characterArray = new char[ 5 ];
// output string1
        Console.WriteLine( "string1: \"" + string1 + "\"" );
// loop through characters in string1 and display reversed
      Console.Write( "The string reversed is: " );
      for ( int i =   - 1; i >= 0; i-- )
      Console.Write( string1[i]  );
// copy characters from string1 into characterArray 
             string1.CopyTo( 0, characterArray, 0, characterArray.Length );
      Console.Write( "\nThe character array is: " );
     for ( int i = 0; i < characterArray.Length  ; i++ )
      Console.Write(characterArray[i]);
 
      Console.WriteLine( "\n" );

// test Length property                                    
       Console.WriteLine( "Length of string1: " + string1.Length );

       Console.ReadLine();
 
        }
    }
}

c# for dummies: c# programing

c# for dummies: c# programing: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace StringManipulationPost {     class Program  ...

c# programing

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StringManipulationPost
{
    class Program
    {
        static void Main(string[] args)
        {
          
              char[] characterArray =                             
                              { 'b', 'i', 'r', 't', 'h', ' ', 'd', 'a', 'y' };
         string originalString = "Welcome to C# programming!";
        string string1 = originalString;                    
        string string2 = new string( characterArray );      
        string string3 = new string( characterArray, 6, 3 );
        string string4 = new string( 'C', 5 );              


    Console.WriteLine( "string1 = " + "\"" + string1 + "\"\n"+
         "string2 = " + "\"" + string2 + "\"\n" +
         "string3 = " + "\"" + string3 + "\"\n" +
         "string4 = " + "\"" + string4 + "\"\n" );

        Console.ReadLine();    
           
        }
    }
}

Tuesday, 23 October 2012

c# for dummies: c sharp classes

c# for dummies: c sharp classes: Cannot insert null value Step 1:         Open the sql server studio Step 2:          open the table in particular i.e unionTB Step3:    ...

c sharp classes

Cannot insert null value

Step 1:
        Open the sql server studio

Step 2:
         open the table in particular i.e unionTB

Step3:
        Tick the column affected allow null




see the pictures.