Trouble with connection string for an .sdf database

fawnfleli

New Member
Having difficulty connecting to an .sdf database.This code gives me the error "The path is not valid. Check the directory for the database."\[code\]@using System;@using System.IO;@using System.Text;@using System.Data;@using System.Data.SqlServerCe;@using System.Collections;@using System.Data.Common;@{SqlCeConnection connection = new SqlCeConnection("Data Source=C:\\Users\\Blahblah\\Documents\\My Web Sites\\App_Data\\Pagelist.sdf;Persist Security Info=False;");SqlCeCommand command = new SqlCeCommand("SELECT * FROM pageinfo WHERE PageID=1",connection);connection.Open();///etc. etc...connection.Close();}\[/code\]
 
Back
Top