sunspotzzz

sunspotzzz

  • NA
  • 31
  • 0

INSERT INTO a Table FROM another Table

Feb 13 2004 10:14 PM
Hi, Wat i am doing is to INSERT into a table values from another table that satisfy the L_Linenumber = temp1 value. the temp1 value is a dynamic one that i get from the LineNumberOcurrencesSmal dataset. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- temp1 = Convert.ToDouble(dsLineNumber.Tables ["LineNumberOccurrencesSmall"].Rows[Increment].ItemArray[0].ToString()); string fillLineNumberSmallGroupRows = "INSERT INTO sunspot. createdTableLineNumberSmallGroupRows(L_OrderKey,L_ PartKey,L_SuppKey,L_LineNumber) SELECT * FROM sunspot.LINEITEM WHERE L_LineNumber =" + temp1; conn = new SqlConnection(source); conn.Open(); SqlCommand cmdFillTableLineNumberSmallGroupRows = new SqlCommand (fillLineNumberSmallGroupRows, conn); cmdFillTableLineNumberSmallGroupRows.ExecuteNonQuery();<--ERROR -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Is my codes corectly writen? I executed the codes in sql query analyzier and it gave me the results but it give me an error msg when I execute it in visual c#.net 2003.

Answers (6)