Posted on: 10/15/2015 1:57:03 PM | Views : 1196

Protected Function GetDatafromDatabase() As DataTable Dim dt As New DataTable() Dim strConnString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString Using con As New SqlConnection(strConnString) con.Open() Dim cmd As New SqlCommand("Select employee_name , designation, salary from employee", con) Dim da As New SqlDataAdapter(cmd) da.Fill(dt) con.Close() End Using Return dt End Function Protected Sub LinkButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton2.Click Response.ClearContent() Response.Buffer = True Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", "salary_Ready_Record.xls")) Response.ContentType = "application/ms-excel" Dim ...

Go to the complete details ...