using the querystring parameter in my where clause to generate insert operation
<p>here,using request.Querystring i find the companyname and job title of particular Job.when user logsin using username in texbix.i want the Companyname,jobtitle and username in the same row of a table.But when i generate my query it inserts the (companyName &amp; jobtitle) in the first row and  username in second row.How can i fulfill my task.Some people said,i have to keep the companyname and jobtitle in a variable...then execute.
is it a parfect solution?
if it is,how can i do that?
code:</p>

<pre><code>protected void ButtonApply_Click(object sender, EventArgs e) {
    String str = Request.QueryString.Get("JobNo");

    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
    conn.Open();

    string apply = "INSERT INTO Company (CompanyName,JobTitle) select CompanyName,JobTitle from Jobs where JobNo='"+str+"'" ; 

    SqlCommand insertApply = new SqlCommand(apply, conn);
    try {
        insertApply.ExecuteScalar();
        conn.Close();
        Response.Redirect("ApplyJob.aspx?JobNo="+str);
    }
</code></pre>

<p>in the apply.aspx i have following code:</p>

<pre><code>SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
conn.Open();

string apply = "INSERT INTO Company (CandidateInformation) Values (@CandidateInformation)" ;

SqlCommand insertApply = new SqlCommand(apply, conn);

insertApply.Parameters.AddWithValue("@CandidateInformation", TextBoxaun.Text);
insertApply.ExecuteNonQuery();

conn.Close();

Response.Redirect("CompanyInfo.aspx");
</code></pre>
