Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7817469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:13:56+00:00 2026-06-02T06:13:56+00:00

I have this code: //check if the user have any previous medical record. var

  • 0

I have this code:

//check if the user have any previous medical record.
var firstMedical = false;
    var sql="SELECT * FROM Medical WHERE CDSID = @0";
    var myMedical = db.QuerySingle(sql1, myCDSID);
    if (myMedical ==null){

                //if all the medical data is filled in, run sql1 to store all the answer into a database.
                var sql10 = "INSERT INTO Medical (Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10, Q11, Q12, Q13, Q14, Q15, Q16, Q17, Q18, Q19, Q20, Alcohol, Medication, Details, CDSID) VALUES (@0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12, @13, @14, @15, @16, @17, @18, @19, @20, @21, @22, @23)";
                var medquestionnaire = new{q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, alcohol, medication, details, myCDSID};
                db.Execute(sql10, medquestionnaire);

    } else {

                var sql2 = "UPDATE Medical SET Q1=@0, Q2=@1, Q3=@2, Q4=@3, Q5=@4, Q6=@5, Q7=@6, Q8=@7, Q9=@8, Q10=@9, Q11=@10, Q12=@11, Q13=@12, Q14=@13, Q15=@14, Q16=@15, Q17=@16, Q18=@17, Q19=@18, Q20=@19, Alcohol=@20, Medication=@21, Details=@22 WHERE CDSID=@23";
                var updquestionnaire = new{q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, alcohol, medication, details, myCDSID};
                db.Execute(sql2,updquestionnaire); //error is highlighted on this line.

     }

Error is highlighted on db.Execute(sql2,updquestionnaire);.

Error is:

Exception Details: System.ArgumentException
 : No mapping exists from DbType <>f__AnonymousType0`24[System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.Object]
   to a known SqlCeType.

I do not understand what this error means and Webmatrix does not really explain this error clearly at all. How should I interpret that error, and fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:13:58+00:00Added an answer on June 2, 2026 at 6:13 am

    Since db.Execute expects an array of objects as the second parameter try changing your new statement to explicitly create an array of objects. Something like this for example…

    var updquestionnaire = new object[] {q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, alcohol, medication, details, myCDSID};
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code : String check=SELECT COUNT(*) as check FROM recordstudent WHERE STUDENT_ID=+T_STUDENT_ID+
Hi all I have this code to check if an item from a textbox
I have the next code: js: $('[id^=check-]').change(function(){ var new_id = this.id.replace(/check/, 'new'), real_id =
i have this code that will check the array contains the specific string and
I have this code that will check for if the class more-results are in
I have this code to set up and check a cookie, and before a
i have this code in c# doc.SelectSingleNode(WhoisRecord/registrant/email).InnerText how can i check whether it is
I have this simple code that speaks for itself. <script language='javascript"> function check() {}
I have a table where each rows has a check box. This code works
Hey all, this is the code i have to check for a day thats

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.