I have one exception (Conversion failed when converting date and/or time from character string.)
how to convert this please help me.
This my coding
protected void Save(object sender, EventArgs e)
{
conn();
string ImgSmall = Path.GetFileName(fileuploadimgsmall.PostedFile.FileName);
fileuploadimgsmall.SaveAs(Server.MapPath("ImagesSmall/" + ImgSmall));
string ImgLarge = Path.GetFileName(fileuploadimglarge.PostedFile.FileName);
fileuploadimglarge.SaveAs(Server.MapPath("ImagesLarge/" + ImgLarge));
objcmd = new SqlCommand("Insert into TBL_PDT_IMG(PDT_ID,IMG_NAME,IMG_DESC,PDT_IMAGE_SMALL,PDT_IMAGE_LARGE,IS_PRIMARY,Created_by,Created_dt,Changed_by,Changed_dt) values(@PDT_ID,@IMG_NAME,@IMG_DESC,@PDT_IMAGE_SMALL,@PDT_IMAGE_LARGE,@IS_PRIMARY,@Created_by,@Created_dt,@Changed_by,@Changed_dt)", objcon.con);
objcmd.Parameters.AddWithValue("@PDT_ID", ddlproduct.SelectedValue);
objcmd.Parameters.AddWithValue("@IMG_NAME", txtimgname.Text.Trim());
objcmd.Parameters.AddWithValue("@IMG_DESC", txtimgdesc.Text.Trim());
objcmd.Parameters.AddWithValue("@PDT_IMAGE_SMALL", "ImagesSmall/" + ImgSmall);
objcmd.Parameters.AddWithValue("@PDT_IMAGE_LARGE", "ImagesLarge/" + ImgLarge);
objcmd.Parameters.AddWithValue("@IS_PRIMARY", chkstatus.Checked);
objcmd.Parameters.AddWithValue("@Created_by", "RG");
objcmd.Parameters.AddWithValue("@Created_dt",DateTime.Now.ToString());
objcmd.Parameters.AddWithValue("@Changed_by", ',');
objcmd.Parameters.AddWithValue("@Changed_dt", ',');
objcmd.ExecuteNonQuery();
bind();
}