I have problem to copy data from one table to another table in SQL database. I am develop the system using C#.Net. I have searching about it from internet, but it not works.
I have two table:
1) Project_Pipeline (company_name, project_name, project_revenue, gross_profit, category_pipeline, status_pipeline, bde_name, deadline, remark, pipeline_id)
2)Proposal_listing (proposal_no, project_name, company_name, start_date, end_date, duration, revenue, status_pipeline, proposal_id)
I want to copy data from Project_Pipeline table to Proposal_listing table where status_pipeline is equal to "Proposal Phase".
I have try the following code, but it didn't works...
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace BDAS
{
public partial class ViewPipeline : System.Web.UI.Page
{
DBConn myDB = new DBConn();
SqlConnection SQLConn = new SqlConnection();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
String company_name;
String project_name;
String project_revenue;
String gross_profit;
String category_pipeline;
String status_pipeline;
String bde_name;
String deadline;
String remark;
String copyData = INSERT INTO Proposal_listing(company_name
, project_name
, status_pipeline) SELECT (company_name
, project_name
, status_pipeline) FROM Project_Pipeline.BDAS WHERE status_pipeline = "Proposal Phase";
}
}
}
My SQL database name is BDAS.dbo
Hope that someone can help me...