now I added My registration pagefor redirecting is
Response.Redirect("ViewJdetailed.aspx?eid='" + txteid.Text + "'");
and my addexp page code is
protected void btnsave_Click(object sender, EventArgs e)
{
String email = Convert.ToString(Request.QueryString["eid"]);
string Str = "insert into Jobseeker_Past(Email,company,fdate,tdate,farea,jobbrief,date1)values('" + email + "','" + Txt_CompanyName.Text + "','" + txtfrom.Text + "','" + txtto.Text + "','" + Drp_Fun.SelectedItem.Text + "','" + Txt_job.Text + "','"+System.DateTime.Now+"')";
SqlCommand cmd = new SqlCommand(Str, cnn);
cnn.Open();
cmd.ExecuteNonQuery();
lblmsg.Text = "Successfully Inserted";
clear();
cnn.Close();
}
protected void clear()
{
Txt_CompanyName.Text = "";
txtfrom.Text = "";
txtto.Text = "";
Drp_Fun.Items.Clear() ;
Txt_job.Text = "";
}
}
but I get error
Incorrect syntax near 'cc@cc'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'cc@cc'.
Source Error:
Line 43: string email = Request.QueryString["eid"].ToString();
Line 44: cmd = new SqlCommand("Select * from registration1 where eid = '" + email + "' ", cnn);
Line 45: dr = cmd.ExecuteReader();
Line 46: dr.Read();
Line 47:
so help.
I created Dp login for upload cv.
My first page is registration page. if it successfully registered it redirect into experence page.
I want to insert email id in table so my code on exp page is like that,
protected void btnsave_Click(object sender, EventArgs e)
{
string email = Convert.ToString(Request.QueryString["eid"]);
string Str = "insert into Jobseeker_Past(Email,company,fdate,tdate,farea,jobbrief,date1)values('" + email + "','" + Txt_CompanyName.Text + "','" + txtfrom.Text + "','" + txtto.Text + "','" + Drp_Fun.SelectedItem.Text + "','" + Txt_job.Text + "','"+System.DateTime.Now+"')";
SqlCommand cmd = new SqlCommand(Str, cnn);
cnn.Open();
int i = cmd.ExecuteNonQuery();
if (i == 1)
{
lblmsg.Text = "Successfully Inserted";
}
else
{
Response.Write("error..");
}
clear();
cnn.Close();
}
protected void clear()
{
Txt_CompanyName.Text = "";
txtfrom.Text = "";
txtto.Text = "";
Drp_Fun.Items.Clear() ;
Txt_job.Text = "";
}
but it takes the email id null.
so how can i insert email id.