Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

[SOLVED] SQL INSERT INTO SELECT

$
0
0
Can I have a SQL INSERT INTO SELECT in the After the record added event?
I try the following code but I get this error
[b][SqlException (0x80131904): Incorrect syntax near 'dbo.'.]runnerDotNet.Connection.query(XVar sql)[/b

My code is
//**********  Insert a record into another table  ************
string strSQLInsert = "insert into dbo.TestGrade (Class, UserIdStu, Divide) select class, UserId, Divide form dbo.StudentList where Class = '"+values["Class"].ToString()+"' and Divide ='"+values["Divide"].ToString()+"'";
CommonFunctions.db_exec(strSQLInsert, null);

Viewing all articles
Browse latest Browse all 2586

Trending Articles