i have created a website for ecommerece
DataTable dt = new DataTable();
string query = "select * from temporder where ipaddress='"+ipAddress+"'";
SqlCommand cmd = new SqlCommand(query, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
foreach (DataRow row in dt.Rows)
{
row["pid"].ToString();
row["pname"].ToString();
row["quantity"].ToString();
row["amount"].ToString();
insert into orderdetails (pi,pname,quantity,amount)values("+row[pid]+","+row[pname]+","+row[quantity]+","+row[amount]+");
}
is this corect
if not please help me to corect this........
there are two table temporder and orderdetails i have to fetch in datatable and insert it another table name orderdetails