Tuesday 21 May 2019

loading multiple tables within dataset using store producer

CREATE PROCEDURE testSP
AS
BEGIN
 SELECT CategoryID,CategoryName,Description FROM Categories 
 SELECT SupplierID,CompanyName,ContactName FROM Suppliers
 SELECT ProductID,ProductName,CategoryID,SupplierID FROM Products
END
GO
C#
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["NorthwindNewConnectionString"].ToString()))
{
 SqlDataAdapter da = new SqlDataAdapter("testSP",conn);
 da.SelectCommand.CommandType = CommandType.StoredProcedure;

 DataSet ds = new DataSet();

 da.Fill(ds);

 DataTable dtCategories = ds.Tables[0];
 DataTable dtSuppliers = ds.Tables[1];
 DataTable dtProducts = ds.Tables[2];
}

Sunday 19 May 2019

C# Advanced Tutorial in Tamil | List with example

 Hi please find the List example below

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

namespace Generics
{
    class Program
    {
        static void Main(string[] args)
        {
            List<string> myclass = new List<string>();
            myclass.Add("Anto");
            myclass.Add("sujesh");
            myclass.Add("balaji");
            myclass.Add("Mani");
            for(int i =0;i < myclass.Count; i++)
            {
                Console.Write(myclass[i] + "\n");
            }
         
            Console.ReadKey();
        }
    }
}



List in tamil | C# Advanced Tutorial  in Tamil |learn C# in tamil | learn csharp in tamil | Generics with example in tamil | Generics with example | csharp Advanced | tamil Tutorial | anto tutorials | anto sj Tutorial | learn c# in tamil | learn csharp in tamil | C# List Tamil | csharp List tamil

Saturday 18 May 2019

C# Advanced Tutorial in Tamil | Generics with example

In this topic i will explain about Generics with example. am going to compare two variable to explain about generics. 


find the code below

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

namespace Generics
{
// declare generics
    public class MyClass<T>
    {
        public bool compare(T a, T b)
        {
            if (a.Equals(b))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
    class Program
    {
        static void Main(string[] args)
        {

            MyClass<string> check = new MyClass<string>();
            bool res = check.compare("A","A");
            Console.Write(res);

            MyClass<int> check1 = new MyClass<int>();
            bool res1 = check1.compare(5, 10);
            Console.Write(res1);
            Console.ReadKey();
        }
    }
}