exported data date and time points to current date and time
===

i have a problem with this script. Whenever i export this set of codes to text file, i want it to be printed according to the date and time i chose, but it shows "Sales-23-07-2012" instead.

For example, i want the text file to be as "Sales - (the date i chose)" rather then "Sales-23-07-2012"  Kindly help.

       namespace MedicalDataExporter

    {

        public partial class frmSales : Form
        {
            public frmSales()
            {
                InitializeComponent();
            }
        
        private void dtpFrom_ValueChanged(object sender, EventArgs e)
        {
            
        }

        private void btnExtract_Click(object sender, EventArgs e)
        {

            SqlConnection objConn = new SqlConnection("Data Source=AKC-105DR-CMS01\\GLOCO;Initial Catalog=Medprac;Persist Security Info=True;User ID=sa;Password=9929");

            objConn.Open();

            SqlCommand objCmd = new SqlCommand("SELECT CONVERT(char(80), InvDate,3) AS InvDate,InvoiceNo,EmployerCode,TaxAmount + SubTotal AS Amount,'' AS Payment FROM Invoice WHERE (InvDate >= CONVERT(datetime, '"+dtpFrom.Text +"', 105 )) AND (InvDate <= CONVERT(datetime, '"+dtpTo.Text+"', 105))", objConn);

            SqlDataReader objReader;
            objReader = objCmd.ExecuteReader();

            System.IO.FileStream fs = new System.IO.FileStream("C:\\CMSExportedData\\Sales-" + DateTime.Now.ToString("dd-MM-yyyy") + ".txt", System.IO.FileMode.Create);
            System.IO.StreamWriter sw = new System.IO.StreamWriter(fs, System.Text.Encoding.Default);

            int count = 0;
            while (objReader.Read())
            {

                for (int i = 0; i < 5; i++)
                {
                    if (!objReader.IsDBNull(i))
                    {
                        string s;
                        s = objReader.GetDataTypeName(i);
                        //MessageBox.Show(s);
                        if (objReader.GetDataTypeName(i) == "char")
                        {
                            sw.Write(objReader.GetString(i));
                        }
                        else if (objReader.GetDataTypeName(i) == "money")
                                                                     
                        {
                            sw.Write(objReader.GetSqlMoney(i).ToString());
                        }
                        else if (objReader.GetDataTypeName(i) == "nvarchar")
                        {
                            sw.Write(objReader.GetString(i));
                        }
                    }
                    if (i < 4)
                    {
                        sw.Write("\t");
                    }

                }
                count = count + 1;
                sw.WriteLine();

            }
            sw.Flush();
            fs.Close();
            objReader.Close();
            objConn.Close();
            MessageBox.Show(count + " records exported successfully.");
            this.Close();
        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }

        private void dtpTo_ValueChanged(object sender, EventArgs e)
        {

        }

        private void frmSales_Load(object sender, EventArgs e)
        {

        }
    }
}

