DataSet ds = default(DataSet);
SqlConnection cnx = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["asdfjkl"].ConnectionString);
String query = "SELECT stamp as 'Date', order_No as 'Order #', places.label as 'Location' FROM order_info, places WHERE places_id = '#' and places.label = 'Detroit, MI' and stamp between @sDate and @eDate";
SqlCommand cmd = new SqlCommand(query, cnx);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@sDate", sDate);
cmd.Parameters.AddWithValue("@eDate", eDate);
SqlDataAdapter da = new SqlDataAdapter(cmd);
try
{
cnx.Open();
da.Fill(ds);
cnx.Close();
}
catch (Exception ex)
{
Debug.Print(ex.Message);
}
finally
{
if (cnx != null) cnx.Close();
}
// I believe the logic here is sound, however, as a C# n00b, I'm slightly at a loss as to what would cause the error I received (e.g., Format of the initialization string does not conform to specification starting at Index 0.) //