Dim strPath As String = "Upload/"
Dim strFileName As String = "EMI.XLS"
Dim strsql As String
strsql = " Select No_Repair, Records_Date, Repair_Name,Section_Re, tel, Serial, Inven_ID, Sending_Date, Plan_Date, Recive_Date, total, Status, Commnts, Supplier,Admin_Name,Quotation from M_send_Repair "
Dim cx As New ConnDB
Dim DT As New DataTable
DT = cx.GetDataTable(strsql)
cx.ExportToText(DT.DefaultView, Server.MapPath("Upload\EMI.XLS"), Chr(9))
Me.lblmsg.Text = "Export Successfully <a href=" & strPath & strFileName & ">Click here</a> "
End Sub