Hi trisetia302,
This error is while saving the record to database.
This error occure because of datatype and the size (length).
Example you have declared varchar[20] as column datatype, but from code its passing as 21 or more character.
So increase the lenghth of the column.
Also you are appending the string after the file name and extension.
So add the datetime before the file name.
Refer below modified code.
protected void UpoadFotoAdmin()
{
if (FileUploadFotoUser.HasFile)
{
string fileName = Path.GetFileName(FileUploadFotoUser.PostedFile.FileName);
string Image = "~/FolderFotoAdmin/" + fileName;
FileUploadFotoUser.PostedFile.SaveAs(Server.MapPath(Image));
string time = DateTime.Now.ToString("yyyyMMddHHmmss");
string GabungNamaFoto = string.Format("{0}{1}{2}", "~/FolderFotoAdmin/", time, fileName);
txtNamaFoto.Text = GabungNamaFoto;
}
else
{
Response.Write("<script> alert('Please Upload your Image')</script>");
}
}