SCOPE_IDENTITY Exception
up vote
1
down vote
favorite
I have been evaluating the use of dapper and the simplecrud extension with sqlite. No matter what I try when doing a table insert things fail with an exception
no such function SCOPE_IDENTITY
Table class
public class User
public int Id get; set;
public string Name get; set;
public int Age get; set;
Simplest piece of code to test
static void Main( string args )
SQLiteConnection conn = new SQLiteConnection( "Data Source=E:\Databases\MyDatabase.db;Version=3" );
conn.Open();
var usr = new User Name = "Dave", Age = 65 ;
var id = conn.Insert(usr);
conn.Close();
As indicated earlier when I run the code the data is inserted into the table but the program terminates with the SCOPE_IDENTITY
exception.
Any assistance would be greatly appreciated
dapper-simplecrud
New contributor
add a comment |
up vote
1
down vote
favorite
I have been evaluating the use of dapper and the simplecrud extension with sqlite. No matter what I try when doing a table insert things fail with an exception
no such function SCOPE_IDENTITY
Table class
public class User
public int Id get; set;
public string Name get; set;
public int Age get; set;
Simplest piece of code to test
static void Main( string args )
SQLiteConnection conn = new SQLiteConnection( "Data Source=E:\Databases\MyDatabase.db;Version=3" );
conn.Open();
var usr = new User Name = "Dave", Age = 65 ;
var id = conn.Insert(usr);
conn.Close();
As indicated earlier when I run the code the data is inserted into the table but the program terminates with the SCOPE_IDENTITY
exception.
Any assistance would be greatly appreciated
dapper-simplecrud
New contributor
SCOPE_IDENTITY
is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe
– marc_s
Nov 10 at 12:05
Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
– hypothesys
Nov 10 at 12:20
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have been evaluating the use of dapper and the simplecrud extension with sqlite. No matter what I try when doing a table insert things fail with an exception
no such function SCOPE_IDENTITY
Table class
public class User
public int Id get; set;
public string Name get; set;
public int Age get; set;
Simplest piece of code to test
static void Main( string args )
SQLiteConnection conn = new SQLiteConnection( "Data Source=E:\Databases\MyDatabase.db;Version=3" );
conn.Open();
var usr = new User Name = "Dave", Age = 65 ;
var id = conn.Insert(usr);
conn.Close();
As indicated earlier when I run the code the data is inserted into the table but the program terminates with the SCOPE_IDENTITY
exception.
Any assistance would be greatly appreciated
dapper-simplecrud
New contributor
I have been evaluating the use of dapper and the simplecrud extension with sqlite. No matter what I try when doing a table insert things fail with an exception
no such function SCOPE_IDENTITY
Table class
public class User
public int Id get; set;
public string Name get; set;
public int Age get; set;
Simplest piece of code to test
static void Main( string args )
SQLiteConnection conn = new SQLiteConnection( "Data Source=E:\Databases\MyDatabase.db;Version=3" );
conn.Open();
var usr = new User Name = "Dave", Age = 65 ;
var id = conn.Insert(usr);
conn.Close();
As indicated earlier when I run the code the data is inserted into the table but the program terminates with the SCOPE_IDENTITY
exception.
Any assistance would be greatly appreciated
dapper-simplecrud
dapper-simplecrud
New contributor
New contributor
edited Nov 10 at 12:05
marc_s
564k12510891242
564k12510891242
New contributor
asked Nov 10 at 11:48
hypothesys
61
61
New contributor
New contributor
SCOPE_IDENTITY
is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe
– marc_s
Nov 10 at 12:05
Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
– hypothesys
Nov 10 at 12:20
add a comment |
SCOPE_IDENTITY
is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe
– marc_s
Nov 10 at 12:05
Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
– hypothesys
Nov 10 at 12:20
SCOPE_IDENTITY
is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe– marc_s
Nov 10 at 12:05
SCOPE_IDENTITY
is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe– marc_s
Nov 10 at 12:05
Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
– hypothesys
Nov 10 at 12:20
Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
– hypothesys
Nov 10 at 12:20
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
Judging from the Github page, it seems the current release has dropped support for SQLite:
Database support
There is an option to change database dialect. Default is Microsoft SQL Server but can be changed to PostgreSQL or MySQL. We dropped SQLite support with the .Net Core release.
SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);
SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);
Depending on which version you have, you might be able to use a similar call to set the SQLite "dialect" (if it's still supported in your code base).
Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
– hypothesys
Nov 10 at 12:32
Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
– hypothesys
Nov 10 at 12:49
@hypothesys: ok, so the support is back in there - and are you callingSimpleCRUD.SetDialect(Dialect.SQLite)
somewhere in your code?
– marc_s
Nov 10 at 12:54
I do now! Brilliant, problem solved. Thanks again.
– hypothesys
Nov 10 at 13:10
@hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
– marc_s
Nov 10 at 13:41
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Judging from the Github page, it seems the current release has dropped support for SQLite:
Database support
There is an option to change database dialect. Default is Microsoft SQL Server but can be changed to PostgreSQL or MySQL. We dropped SQLite support with the .Net Core release.
SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);
SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);
Depending on which version you have, you might be able to use a similar call to set the SQLite "dialect" (if it's still supported in your code base).
Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
– hypothesys
Nov 10 at 12:32
Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
– hypothesys
Nov 10 at 12:49
@hypothesys: ok, so the support is back in there - and are you callingSimpleCRUD.SetDialect(Dialect.SQLite)
somewhere in your code?
– marc_s
Nov 10 at 12:54
I do now! Brilliant, problem solved. Thanks again.
– hypothesys
Nov 10 at 13:10
@hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
– marc_s
Nov 10 at 13:41
add a comment |
up vote
1
down vote
Judging from the Github page, it seems the current release has dropped support for SQLite:
Database support
There is an option to change database dialect. Default is Microsoft SQL Server but can be changed to PostgreSQL or MySQL. We dropped SQLite support with the .Net Core release.
SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);
SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);
Depending on which version you have, you might be able to use a similar call to set the SQLite "dialect" (if it's still supported in your code base).
Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
– hypothesys
Nov 10 at 12:32
Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
– hypothesys
Nov 10 at 12:49
@hypothesys: ok, so the support is back in there - and are you callingSimpleCRUD.SetDialect(Dialect.SQLite)
somewhere in your code?
– marc_s
Nov 10 at 12:54
I do now! Brilliant, problem solved. Thanks again.
– hypothesys
Nov 10 at 13:10
@hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
– marc_s
Nov 10 at 13:41
add a comment |
up vote
1
down vote
up vote
1
down vote
Judging from the Github page, it seems the current release has dropped support for SQLite:
Database support
There is an option to change database dialect. Default is Microsoft SQL Server but can be changed to PostgreSQL or MySQL. We dropped SQLite support with the .Net Core release.
SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);
SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);
Depending on which version you have, you might be able to use a similar call to set the SQLite "dialect" (if it's still supported in your code base).
Judging from the Github page, it seems the current release has dropped support for SQLite:
Database support
There is an option to change database dialect. Default is Microsoft SQL Server but can be changed to PostgreSQL or MySQL. We dropped SQLite support with the .Net Core release.
SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);
SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);
Depending on which version you have, you might be able to use a similar call to set the SQLite "dialect" (if it's still supported in your code base).
answered Nov 10 at 12:26
marc_s
564k12510891242
564k12510891242
Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
– hypothesys
Nov 10 at 12:32
Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
– hypothesys
Nov 10 at 12:49
@hypothesys: ok, so the support is back in there - and are you callingSimpleCRUD.SetDialect(Dialect.SQLite)
somewhere in your code?
– marc_s
Nov 10 at 12:54
I do now! Brilliant, problem solved. Thanks again.
– hypothesys
Nov 10 at 13:10
@hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
– marc_s
Nov 10 at 13:41
add a comment |
Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
– hypothesys
Nov 10 at 12:32
Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
– hypothesys
Nov 10 at 12:49
@hypothesys: ok, so the support is back in there - and are you callingSimpleCRUD.SetDialect(Dialect.SQLite)
somewhere in your code?
– marc_s
Nov 10 at 12:54
I do now! Brilliant, problem solved. Thanks again.
– hypothesys
Nov 10 at 13:10
@hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
– marc_s
Nov 10 at 13:41
Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
– hypothesys
Nov 10 at 12:32
Marc_s, that would explain it. I had missed that comment in the release, but had been misguided by the fact that the test code on github still references sqlite as a provider. Thank you.
– hypothesys
Nov 10 at 12:32
Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
– hypothesys
Nov 10 at 12:49
Marc_s, looks like we have some confusion here, looking through the history on github, sqlite support was removed as of version 2.0.0 but was re-added as of version 2.0.1 which is the current version on nuget and what I have been using. Maybe the re-adding is not quite right.
– hypothesys
Nov 10 at 12:49
@hypothesys: ok, so the support is back in there - and are you calling
SimpleCRUD.SetDialect(Dialect.SQLite)
somewhere in your code?– marc_s
Nov 10 at 12:54
@hypothesys: ok, so the support is back in there - and are you calling
SimpleCRUD.SetDialect(Dialect.SQLite)
somewhere in your code?– marc_s
Nov 10 at 12:54
I do now! Brilliant, problem solved. Thanks again.
– hypothesys
Nov 10 at 13:10
I do now! Brilliant, problem solved. Thanks again.
– hypothesys
Nov 10 at 13:10
@hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
– marc_s
Nov 10 at 13:41
@hypothesys: if this answer helped you solve your problem, then please accept this answer. This will show your appreciation for the people who spent their own time to help you.
– marc_s
Nov 10 at 13:41
add a comment |
hypothesys is a new contributor. Be nice, and check out our Code of Conduct.
hypothesys is a new contributor. Be nice, and check out our Code of Conduct.
hypothesys is a new contributor. Be nice, and check out our Code of Conduct.
hypothesys is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238627%2fscope-identity-exception%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
SCOPE_IDENTITY
is a SQL Server function (and therefore not available in SQLite, obviously) - no idea why does would be showing up in your case..... Is there anything with Dapper or the Dapper extension that defaults to SQL Server, and you have to change it to SQLite, maybe– marc_s
Nov 10 at 12:05
Marc_s, thanks your your reply. Not that I am aware of and have been unable to see anything in sample code on github, thus leading to extreme frustration.
– hypothesys
Nov 10 at 12:20