INSERT INTO a Table FROM another Table
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.
sunspotzzzPosted Mar 1, 2004, 2:42 AM
mikerPosted Feb 19, 2004, 7:43 AM
sunspotzzzPosted Feb 19, 2004, 2:32 AM
mikerPosted Feb 17, 2004, 7:39 AM
sunspotzzzPosted Feb 16, 2004, 9:33 PM
mikerPosted Feb 16, 2004, 7:04 AM