sqlce 3.5 insert not working

D

dev100

Hi, i have created a sqlce 3.5 database in vs2008 for cf 2.0 app which has
a single table
Product:

id bigint 8
no bigint 8
prodname nvarchar 100
instock bit
no2 bigint
no3 bigint

Ive used the graphical tools in vs2008 to create a tableadapter with
dbdirect methods.
I then call insert as follows in my C# code in a unit test
ProductTableAdapter ta = new ProductTableAdapter ();

ProductTA.Insert(0, 0, "MyProduct", false, 0, 0);

However the insert throws an exception

Unspecified error [ \\Program Files\\SmartDeviceTest\\Out\\testdb.sdf

Is this something to do with not being able to locate the database? I have
copied the database

to the unit test directory on the device but makes no difference. Im not
sure what the error means.



__________ Information from ESET Smart Security, version of virus signature database 4109 (20090527) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
D

dev100

just some more info its a SqlceException
native error code : 25046
Stack trace shows as final few statements

at System.Data.SqlServerCe.SqlCeConnection.ProcessResults()
at System.Data.SqlServerCe.SqlCeConnection.Open()
at System.Data.SqlServerCe.SqlCeConnection.Open()




dev100 said:
Hi, i have created a sqlce 3.5 database in vs2008 for cf 2.0 app which
has a single table
Product:

id bigint 8
no bigint 8
prodname nvarchar 100
instock bit
no2 bigint
no3 bigint

Ive used the graphical tools in vs2008 to create a tableadapter with
dbdirect methods.
I then call insert as follows in my C# code in a unit test
ProductTableAdapter ta = new ProductTableAdapter ();

ProductTA.Insert(0, 0, "MyProduct", false, 0, 0);

However the insert throws an exception

Unspecified error [ \\Program Files\\SmartDeviceTest\\Out\\testdb.sdf

Is this something to do with not being able to locate the database? I have
copied the database

to the unit test directory on the device but makes no difference. Im not
sure what the error means.



__________ Information from ESET Smart Security, version of virus
signature database 4109 (20090527) __________

The message was checked by ESET Smart Security.

http://www.eset.com



__________ Information from ESET Smart Security, version of virus signature database 4109 (20090527) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
D

dev100

just some more info its a SqlceException
native error code : 25046
Stack trace shows as final few statements

at System.Data.SqlServerCe.SqlCeConnection.ProcessResults()
at System.Data.SqlServerCe.SqlCeConnection.Open()
at System.Data.SqlServerCe.SqlCeConnection.Open()




dev100 said:
Hi, i have created a sqlce 3.5 database in vs2008 for cf 2.0 app which
has a single table
Product:

id bigint 8
no bigint 8
prodname nvarchar 100
instock bit
no2 bigint
no3 bigint

Ive used the graphical tools in vs2008 to create a tableadapter with
dbdirect methods.
I then call insert as follows in my C# code in a unit test
ProductTableAdapter ta = new ProductTableAdapter ();

ProductTA.Insert(0, 0, "MyProduct", false, 0, 0);

However the insert throws an exception

Unspecified error [ \\Program Files\\SmartDeviceTest\\Out\\testdb.sdf

Is this something to do with not being able to locate the database? I have
copied the database

to the unit test directory on the device but makes no difference. Im not
sure what the error means.



__________ Information from ESET Smart Security, version of virus
signature database 4109 (20090527) __________

The message was checked by ESET Smart Security.

http://www.eset.com



__________ Information from ESET Smart Security, version of virus signature database 4109 (20090527) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
T

Trevor

dev100 said:
just some more info its a SqlceException
native error code : 25046
Stack trace shows as final few statements

at System.Data.SqlServerCe.SqlCeConnection.ProcessResults()
at System.Data.SqlServerCe.SqlCeConnection.Open()
at System.Data.SqlServerCe.SqlCeConnection.Open()

I think you will find this useful:
http://technet.microsoft.com/en-us/library/ms171849.aspx

I got this information from that link:

25046
SSCE_M_FILENOTFOUND
The database file cannot be found. Check the path to the database.
 
T

Trevor

dev100 said:
just some more info its a SqlceException
native error code : 25046
Stack trace shows as final few statements

at System.Data.SqlServerCe.SqlCeConnection.ProcessResults()
at System.Data.SqlServerCe.SqlCeConnection.Open()
at System.Data.SqlServerCe.SqlCeConnection.Open()

I think you will find this useful:
http://technet.microsoft.com/en-us/library/ms171849.aspx

I got this information from that link:

25046
SSCE_M_FILENOTFOUND
The database file cannot be found. Check the path to the database.
 
S

Simon Hart [MVP]

This is probably because the MSTest Engine (I'm assuming you are using
MSTest based on the output path) doesn't copy the database to the out
directory automatically. You have to explicitly define it. One method -
using the DeploymentItemAttribute is talked about here that might help:
http://www.simonrhart.com/2009/04/copying-dependency-files-to-output.html

--
Simon Hart
Visual Developer - Device Application Development MVP
http://www.simonrhart.com

dev100 said:
just some more info its a SqlceException
native error code : 25046
Stack trace shows as final few statements

at System.Data.SqlServerCe.SqlCeConnection.ProcessResults()
at System.Data.SqlServerCe.SqlCeConnection.Open()
at System.Data.SqlServerCe.SqlCeConnection.Open()




dev100 said:
Hi, i have created a sqlce 3.5 database in vs2008 for cf 2.0 app which
has a single table
Product:

id bigint 8
no bigint 8
prodname nvarchar 100
instock bit
no2 bigint
no3 bigint

Ive used the graphical tools in vs2008 to create a tableadapter with
dbdirect methods.
I then call insert as follows in my C# code in a unit test
ProductTableAdapter ta = new ProductTableAdapter ();

ProductTA.Insert(0, 0, "MyProduct", false, 0, 0);

However the insert throws an exception

Unspecified error [ \\Program Files\\SmartDeviceTest\\Out\\testdb.sdf

Is this something to do with not being able to locate the database? I
have copied the database

to the unit test directory on the device but makes no difference. Im not
sure what the error means.



__________ Information from ESET Smart Security, version of virus
signature database 4109 (20090527) __________

The message was checked by ESET Smart Security.

http://www.eset.com



__________ Information from ESET Smart Security, version of virus
signature database 4109 (20090527) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
S

Simon Hart [MVP]

This is probably because the MSTest Engine (I'm assuming you are using
MSTest based on the output path) doesn't copy the database to the out
directory automatically. You have to explicitly define it. One method -
using the DeploymentItemAttribute is talked about here that might help:
http://www.simonrhart.com/2009/04/copying-dependency-files-to-output.html

--
Simon Hart
Visual Developer - Device Application Development MVP
http://www.simonrhart.com

dev100 said:
just some more info its a SqlceException
native error code : 25046
Stack trace shows as final few statements

at System.Data.SqlServerCe.SqlCeConnection.ProcessResults()
at System.Data.SqlServerCe.SqlCeConnection.Open()
at System.Data.SqlServerCe.SqlCeConnection.Open()




dev100 said:
Hi, i have created a sqlce 3.5 database in vs2008 for cf 2.0 app which
has a single table
Product:

id bigint 8
no bigint 8
prodname nvarchar 100
instock bit
no2 bigint
no3 bigint

Ive used the graphical tools in vs2008 to create a tableadapter with
dbdirect methods.
I then call insert as follows in my C# code in a unit test
ProductTableAdapter ta = new ProductTableAdapter ();

ProductTA.Insert(0, 0, "MyProduct", false, 0, 0);

However the insert throws an exception

Unspecified error [ \\Program Files\\SmartDeviceTest\\Out\\testdb.sdf

Is this something to do with not being able to locate the database? I
have copied the database

to the unit test directory on the device but makes no difference. Im not
sure what the error means.



__________ Information from ESET Smart Security, version of virus
signature database 4109 (20090527) __________

The message was checked by ESET Smart Security.

http://www.eset.com



__________ Information from ESET Smart Security, version of virus
signature database 4109 (20090527) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
Top