I want to create a empty local database inside my project's folder and I've error:
An unhandled exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll
on the line
conn.Open();
I'm lost with what I need to do. Any idea what is causing this? I tried a few solutions - this one of them...
SqlCeConnection conn = null;
try
{
conn = new SqlCeConnection("Data Source = bd-avalia.sdf; Password ='<asdasd>'");
conn.Open();
SqlCeCommand cmd = conn.CreateCommand();
cmd.CommandText = "create table cliente(id_cliente int identity not null primary key, nome varchar not null, password not null int)";
cmd.ExecuteNonQuery();
}
finally
{
conn.Close();
}
the error:

bd-avalia.sdfreally exist in the current run directory? If you're running this inside Visual Studio, the app is run inside the(project-directory)\bin\debugfolder - is that.sdffile available there? Try using a full, complete path - does that work?"Data Source=|DataDirectory|\bd-avalia.sdf; ...".