problem in linking

Reply Forum
Forum posttbs @ 2011-11-30 12:21:50
ReplyReply to
I created a CV upload form with firstname, lastname, emailID, mobile,technology,company name,exp, uploading CV and captcha. this is my .cs file. i need to check the captcha, file uploaded or not and whether remaining fields are filled or not then i need to upload the file to database or else it should show me the error Error while uploading. please help me out from this.
TBS

protected void btnSubmit_Click(object sender, EventArgs e)
{
s = ConfigurationManager.ConnectionStrings["testDBConnectionString"].ConnectionString;
con = new SqlConnection(s);
con.ConnectionString = "Data Source=ADMIN-PC;Initial Catalog=testDB;User ID=sa;Password=tbs123";
con.Open();
cmd = new SqlCommand("insert into CVTable values('" + txtFirstName.Text + "','" + txtLastName.Text + "','" + txtEmailID.Text + "','" + txtMobile.Text + "','" + txtTechnology.Text + "','" + txtCompany.Text + "','" + txtDesignation.Text + "','" + txtExp.Text + "','" + FileUpload1.FileName + "')", con);
int cnt = int.Parse(cmd.ExecuteNonQuery().ToString());

//cmd.ExecuteNonQuery();
if (txtverification.Text == txt1.Value && FileUpload1.HasFile && cnt >0)
{

FileUpload1.SaveAs("D:\\Haritha\\Uploads\\" + FileUpload1.FileName + ISO_Date());
lblmsg.Text = string.Format("Ur Details Succesfully Uploaded");
}
else
{
lblmsg.Text = string.Format("Un-successfull");
}
con.Close();
clear();
}











© net-tutorials.com 2006 - 2012

MailContact net-tutorials.com