I am new to develop a Web Application. please tell me how to upload a image in to our form and at the same time save into the sqlserver table.
thanq in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Santhosh Kumar JayaramanPosted Jul 28, 2012, 3:10 AM
Shubham SaxenaPosted Jul 28, 2012, 3:06 AM
<form id="form1" runat="server">
<div>
<asp:FileUpload ID="fileuploadimages" runat="server" />
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click" />
div>
.cs file
protected void btnSubmit_Click(object sender, EventArgs e)
{
string filename = Path.GetFileName(fileuploadimages.FileName); ;
//Save images into Images folder
fileuploadimages.SaveAs(Server.MapPath("~/" + filename));
}
Cheers