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 8947137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:40:40+00:00 2026-06-15T12:40:40+00:00

It has long been true that you can execute multiple statements with SQL CE

  • 0

It has long been true that you can execute multiple statements with SQL CE. And in fact I’m using SQL Server Compact Toolbox to do exactly that. But when I take the same multiple-statement commands and execute them from Dapper…

public const string SampleDml = @"
   INSERT INTO [Plugin](Name, TypeName) VALUES ('Blog','Shroom.Blog');
   GO
   INSERT INTO [ContentDef](PluginID, Name, Placement, IsStatic) VALUES(@@IDENTITY,'MyBlog','Layout:Left',1);
   GO
";

I then keep getting this error:

There was an error parsing the query. [ Token line number =3, Token line offset = 1, Token in error = GO ]

The version of the SQL CE library I’m using is version 4.0.0.0 (runtime version v2.0.50727). I’m using Dapper 1.12.0.0 (runtime version v4.0.30319) and Dapper Extensions 1.3.2.0 (runtime v4.0.30319).

The SQL CE library seems like the wrong run-time, but web platform installer says I have the latest (so that really is the latest?). Thoughts?

  • 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-15T12:40:42+00:00Added an answer on June 15, 2026 at 12:40 pm

    You actually can only execute a single statement per batch with SQL Server Compact, all I do (I am the SQL Server Compact Toolbox author), is split the string per GO and newline.

    I have code like this:

            using (StringReader reader = new StringReader(script))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    line = line.Trim();
                    if (line.Equals("GO", StringComparison.OrdinalIgnoreCase))
                    {
                        RunCommand(sb.ToString(), dataset);
                        sb.Remove(0, sb.Length);
                    }
                    else
                    {
                        sb.Append(line);
                        sb.Append(Environment.NewLine);
                    }
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a big question that has been puzzling me for a long time
How can I code to see how long the computer has been on. Simple
Is there a way to test, using Python, how long the system has been
It has long been known that PDO does not support COUNT(*) and a query
It has been a long time since I used java and I have run
Does Windows XP (and up) store how long it has been... ...since the system
This has been pending for a long time in my list now. In brief
This problem has been bugging me for a long time. For example, the code
This question has been bugging me for a long time now but essentially I'm
This question has been puzzling me for a long time now. I come from

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.