Showing posts with label Difference. Show all posts
Showing posts with label Difference. Show all posts

Thursday, 24 March 2016

Complete Comparison for VB.NET and C#

1 comment    
categories: , , ,

Complete Comparison for VB.NET and C#


Visual Basic [.NET] (VB.NET) is a multi-paradigm, high-level programming language, implemented on the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language.


C# (pronounced "C-sharp") is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java. C# is designed to work with Microsoft's .Net platform.

VB.Net Namespace


Imports System.Data
Imports System.Data.SqlClient
Imports System.IO


C# Namespace


using System.Data;
using System.Data.SqlClient;
using System.IO;


VB.NET Page Load 

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
      
    End Sub


C# Page Load 


protected void Page_Load(object sender, EventArgs e)
    {     

    }


VB.NET Varibles


Dim str As String
str = "VB.NET"
  
Dim cmd As SqlCommand = New SqlCommand()
Dim con As SqlConnection = New SqlConnection()


C# Varibles

SqlCommand cmd = new SqlCommand();
SqlConnection con = new SqlConnection();
string str="";
str="C#";


VB.NET Database ConnectionString


Dim con As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("dbcon").ConnectionString)
       
con.Open()


C# Database ConnectionString


SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dbcon"].ToString());

        con.Open();


VB.NET If Condition

 Dim s As String = "VB.NET"
        If s = "VB.NET" Then
            Response.Write("Success")
        Else
            Response.Write("Not Success")
        End If


C# If Condition


string s = "C#";
        if (s == "C#")
        { 
            Response.Write("Success");
        }
        else
        {
            Response.Write("Not Success");
        }


VB.NET Function/Methods


Public Sub bind()

    End Sub

Protected Sub bind()

    End Sub

Private Sub bind()

    End Sub


C# Function/Methods

Public void bind()
{
}
Protected void bind()
{
}
Private void bind()
{
} 

VB.NET  WebForm Call

        Response.Redirect("Login.aspx")

C#  WebForm Call



        Response.Redirect("Login.aspx");

VB.NET Image Upload to Server Folder

Dim imgname As String = FileUpload1.PostedFile.FileName

            FileUpload1.SaveAs(Server.MapPath("img/" + imgname))


 C# Image Upload to Server Folder

 String imgname = FileUpload1.PostedFile.FileName;

            FileUpload1.SaveAs(Server.MapPath("img/" + imgname));

VB.NET Access Session

            lbtUsername.Text = Session("username").ToString()

C# Access Session


      lbtUsername.Text = Session["username"].ToString();


VB.NET Access Gridview Events


Protected Sub Button1_Click(sender As Object, e As EventArgs)

        Dim btn As Button = CType(sender, Button)
        Dim row As GridViewRow = CType(btn.NamingContainer, GridViewRow)
        Dim lblAmount1 As String = DirectCast(row.FindControl("Label2"), Label).Text   
    
    End Sub

// Gridview events

        Dim lblid As String = DirectCast(GridView22.Rows(e.RowIndex).FindControl("Label2"), Label).Text


C# Access GridView Events

protected void Button1_Click(object sender, EventArgs e)
    {
        Button btn = (Button)sender;
        GridViewRow row = (GridViewRow)btn.NamingContainer;
        Label lblAmount1 = (Label)row.FindControl("Label2");
    }

 // Gridview events

Label lblid = (Label)GridView1.Rows[e.RowIndex].FindControl("Label2");





Friday, 6 November 2015

What is the Difference between Eval() and Bind Methods




Friday, 10 April 2015

Difference Between For Loop and ForEach Loop Using C#



Difference Between For Loop and ForEach Loop




Tuesday, 24 March 2015

Difference Between Primary Key and Foreign Key in SQL


Difference Between Primary Key and Foreign Key


Difference Between Primary Key and Unique Key


Difference Between Primary Key and Unique Key 





Monday, 23 March 2015

Difference Between Panel and Multiview in Asp.Net

No comments    
categories: , ,
Difference Between Panel and Multiview


Difference Between ArrayList And GenericList in Asp.Net

Difference Between ArrayList And  GenericList



Difference Between Boxing and Unboxing in Asp.Net

No comments    
categories: , ,
Difference Between Boxing and Unboxing 



Wednesday, 4 March 2015

Difference Between JavaScript And JQuery Using Asp.Net C#


Difference Between JavaScript And JQuery








Monday, 2 March 2015

Difference Between String And StringBuilder Using in Asp.Net C#


Difference Between String And StringBuilder 







Tuesday, 17 February 2015

Difference Between C# And VB.NET Using in Asp.Net

1 comment    
categories: , , ,
Difference Between C# And VB.NET Using in Asp.Net



Monday, 5 January 2015

Difference between Web site and Web application

Difference Between Web site and Web application 






Friday, 2 January 2015

Difference Between MVC Razor View Engine and ASPX View Engine


Razor View Engine and ASPX View Engine










Tuesday, 30 December 2014

Difference Between ExecuteNonQuery() And ExecuteScalar() Methods Using ADO.NET

No comments    
categories: , , ,

Difference Between ExecuteNonQuery() And ExecuteScalar()





Wednesday, 17 December 2014

Difference Between Asp.Net WebForms And ASP.NET MVC

No comments    
categories: , ,
Difference Between Asp.Net WebForms And ASP.NET MVC




Tuesday, 16 December 2014

Difference Between DataReader and DataAdapter



         Difference Between  DataReader  and DataAdapter

Sunday, 30 November 2014

Difference Between DataSet and DataTable


Wednesday, 8 October 2014

Difference Between ListView and GridView in Asp.Net C#

Difference Between ListView and GridView



Difference Between GridView and DataGrid in Asp.Net C#



Difference Between GridView and DataGrid



                                                i think useful this post.