Connect local database c# -
i want create empty local database inside project's folder , i've error:
an unhandled exception of type 'system.data.sqlserverce.sqlceexception' occurred in system.data.sqlserverce.dll
on line
conn.open();
i'm lost need do. idea causing this? tried few solutions - 1 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(); } { conn.close(); }
the error:
if debug code (or output somehow) can check nativeerror
property of sqlceexception
, should tell cause of exception.
see http://technet.microsoft.com/en-us/library/aa237948(v=sql.80).aspx explanation of code.
Comments
Post a Comment