You need to use CultureInfo for converting the MM/dd/yyy format.
HTML
<asp:TextBox ID="txtOrderDate" Text="05/07/1996" runat="server" />`
<asp:Button Text="Search Name With Order Date" OnClick="SearchNameWithOrderDate"
runat="server" />
Namespaces
using System.Configuration;
using System.Data.SqlClient;
using System.Globalization;
C#
protected void SearchNameWithOrderDate(object sender, EventArgs e)
{
string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(conString))
{
using (SqlCommand cmd = new SqlCommand("SELECT FirstName FROM Employees employees INNER JOIN Orders orders ON employees.EmployeeId = orders.EmployeeId WHERE OrderDate = @OrderDate", con))
{
cmd.Parameters.AddWithValue("@OrderDate", Convert.ToDateTime(this.txtOrderDate.Text.ToString(),new CultureInfo("en-GB")));
con.Open();
object name = cmd.ExecuteScalar();
con.Close();
if (name != null)
{
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + name.ToString() + "')", true);
}
}
}
}