c# - insert into table from another table and values -
i want insert table info , textbox value in table. trying insert command below not working.
insert table_useranswer ( userquizid, quizid, questionid, title, answer1, answer2, answer3, answer4, correctanswer ) '" + m.tostring() + "', select top 5 quizid, questionid, title, answer1, answer2, answer3, answer4, correctanswer [table_question] order newid()"
use insert into...select
statement,
insert table_useranswer ( userquizid, quizid, questionid, title, answer1, answer2, answer3, answer4, correctanswer) select top 5 'userquizidvalue', quizid, questionid, title, answer1, answer2, answer3, answer4, correctanswer table_question order newid()
the value of userquizidvalue
m.tostring()
.
c# asp.net sql sql-server sql-insert
No comments:
Post a Comment