Categories
Program Tutorial

Basic Program in LINQ Query

In our program we are going to use Object as our data source, if you want to understand LINQ query completely read this article How to understand LINQ Query. Basic LINQ Program using System; using System.Linq; namespace LinqQuery2 { class Program { static void Main(string[] args) { String[] myInput = new string[] { “one”, “two”, […]

Categories
Tutorial

LINQ Query Syntax

SYNTAX var <variableName>=from <type of value to return> <dummyVariable> in <SourceName> select <dummyVariable> var – is an data type for LINQ query <variableName> – it is an variable used to store data in LINQ query. <type of value to return> – It is an data type of output. i.e string, int etc. <dummyVariable> – it is […]

Categories
Program Tutorial

Understanding LINQ Query in ADO.NET

LINQ (Language Integrated Query) When creating a dynamic Web Application, you need to retrieve data from various data sources such as flat file, xml file, or a database. To access data from these disparate data sources, you need to learn and implement different techniques to retrieve an data from data source. This complicates your task […]

Categories
C# / .NET Program

C# program for Palindrome String

Read “how to reverse an string” to understand palindrome program. Program using System; namespace PalindromeOrNot { class Program { static void Main(string[] args) { string input, output; Console.WriteLine(“Enter an String to check for Palindrome : “); input = Console.ReadLine(); char[] pal=input.ToCharArray(); Array.Reverse(pal); output= new string(pal); if(input==output) { Console.WriteLine(“The given string is Palindrome !”); } else […]

Categories
C# / .NET Program

C# program to reverse a String

This is an simple C# program to reverse a string Program using System; namespace StringReverseProgram { class Program { static void Main(string[] args) { string input, output; Console.Write(“Enter an string to reverse: “); input = Console.ReadLine(); //Converting an String datatype to Char Array datatype for easy reverse operation char[] rev = input.ToCharArray(); Array.Reverse(rev); //Again converting […]

Categories
C# / .NET Program

How to reverse an Number in C# Program with explanation

Explanation If given value is 125, Divide 125/10, you will get remainder 5 and quotient 12. Store that 5 into output and store quotient into input. Again divide an input 12/10, you will get remainder  2 and quotient 1. Store that 2 into output as 5*10+2,  so the value will be 52. Perform these above step […]

Categories
C# / .NET Program

Substring method in C# using Single Arugment

Read “SubString method” to understand the working of SubString method in C# Program using System; namespace StringFunctions { class Program { static void Main(string[] args) { string input = “HAIHOWAREYOU”; string output=input.Substring(3); Console.WriteLine(output); Console.ReadKey(); } } }  Output HOWAREYOU  

Categories
C# / .NET Program

C# SubString Function program (with example)

Substring: It is an method provided by String class. It accepts 2 arguments. (String start value, Length of string) Argument should be integer value. Syntax Substring(int StartIndex,int Length)  Example If we use Substring(3,5) , the output will be as below. “HOWAR”   Program for Substring using System; namespace StringFunctions { class Program { static void […]

Categories
Program Tutorial

Understanding GridView Code Behind in ASP .NET (with example)

Before going through to GridView Code Behind file, you must know to use GridView control from drag and drop in Design view of ASP .NET. Read this “How to use GridView Control..” article to understand the GridView in simple drag and drop. Sample Code: <asp:GridView ID=”GridView1″ runat=”server” AutoGenerateColumns=”FALSE” DataSourceID=”SqlDataSource1″> <Columns> <asp:BoundField DataField=”fname” HeaderText=”fname” SortExpression=”fname” /> […]

Categories
Tutorial

How to use GridView Control in ASP.NET

GridView Control is an very important topic that every students and programmers should know. I have faced this question in my 2 question, they simply ask us to write the GridView Asp .NET coding. Let us understand how to use GridView in ASP .NET. STEP 1: Open an black ASP .NET website from Visual Studio. […]