1.Hi pls place u r connection string in place of my con string. 2. 3.paste this code in codebehind.. imports system.data.sqlclient Dim conObj As New SqlConnection Dim adpObj As New SqlDataAdapter Dim dsObj As New DataSet Dim sort As String Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then bindGrid() If sort = "" Then sort = "name" End If End If End Sub Sub bindGrid() Try conObj = New SqlConnection("Data Source=B4B-2F-323-CK26;user id=sa;password=sa;Database=TEST") conObj.Open() adpObj = New SqlDataAdapter("SELECT * FROM Login", conObj) adpObj.Fill(dsObj, "Login") Dim dt As DataTable = dsObj.Tables("Login") Dim dv As DataView = New DataView(dt) dv.Sort = sort DataGrid1.DataSource = dv DataGrid1.DataBind() Catch ex As Exception Response.Write(ex.ToString()) End Try End Sub Private Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles DataGrid1.SortCommand sort = e.SortExpression bindGrid() End Sub End Class :laugh: