How to convert MS Access date to string in C#
<p>I was able to gather data from Access into my texboxes, but the dates won't stop giving errors. Is there a way to grab dates or is that impossible? No where on this site can I find a souluiton to convert dates to strings to display into a textbox. Any help would be great or I have to change the database dates to strings.</p>

<p>//Dates not displaying, only errors in the while loop
//strBirthday = dr["STU_BIRTHDAY"].ToString();  This won't diplay like the other 2 strings. </p>

<p>protected void btnQuery_Click(object sender, EventArgs e)
        {
            OleDbConnection con = new OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0; Data Source = C:\collection\database.accdb");
            string strQueryString = "SELECT STU_NAME, STU_ADDRESS, STU_BIRTHDATE FROM Students WHERE STU_ID = @SID";
            OleDbCommand com = new OleDbCommand(strQueryString, con);
            com.Parameters.AddWithValue("SID", txtStuID.Text.Trim());
            con.Open();
            OleDbDataReader dr = com.ExecuteReader();</p>

<pre><code>        string strName = "";
        string strAddress = "";
        string strBirthday = "";

        while (dr.Read())
        {
            strName = dr["STU_NAME"].ToString();
            strAddress = dr["STU_ADDRESS"].ToString();
            strBirthday = dr["STU_BIRTHDAY"].ToString();   
        }
        txtStuName.Text = strName;
        txtStuAddress.Text = strAddress;
        txtStuBirthDate.Text = strBirthday;
        dr.Close();
        con.Close();
    }
</code></pre>
