View Full Version : [GUIDE] Using Sql Server Compact Edition 4.0 on VC#2010 ExpEd sp1


sephiroth111
11th Jun 2012 Mon, 23:16
Baka makatulong :)
Alam natin na ang Sql Server Compact Edition 4.0 designer ay hindi supported ng Visual C# 2010 express edition sp1.
Walang designer kahit pa magcreate ng database unlike Visual Web Developer 2010 sp1 na merong designer at pwede magcreate ng CE4.0 database kaya pwd ka makapagcreate ng Database, tables relationship etc...
Ito na...
1. Siguraduhin na Meron kang Visual C# 2010 express edition sp1 at Visual Web developer 2010 express sp1.
2. Download Sql Server Compact Edition 4.0 sp1 (http://www.microsoft.com/en-us/download/details.aspx?id=29037) at install.
3. Open visual c# 2010 express and create a project.
4. Import from Solution Explorer>Reference ang System.Data.SqlServerCe v4.0.
5. Open Visual Web Developer 2010 and create a project.
6. Open Database Explorer>Add Connection>Change>Microsoft Sql Server Compact 4.0>OK>Create>(Create filename(Path where do you want to save the .sdf file)>OK>YES>Tes Connection>(if connection successful)OK.
7. Go back to Database Exploerer>filename.sdf>table>Create Table(kayo na bahala kung marunong ka magquery) then save.
8. Go back to Visual C# project, create a connectioni:

//Standard connection string
SqlCeConnection conn = new SqlCeConnection("Data Source=path of .sdf file; Persist Security Info=False;");
conn.Open();
MessageBox.Show("Connection Successful");
conn.Close();

Kung magprompt ang messagebox ay ang connection ay connected pero kung kung error baka mali ang directory path for your .sdf file.
Sana nakatulong anng thread na to :)

Sa madaling salita ay gagawin natin database designer ang Visual Web Developer 2010 :)

polens
12th Jun 2012 Tue, 19:24
sqlCE ka parin pala...
yaw ng sqlite? for standalone apps..

sephiroth111
12th Jun 2012 Tue, 22:56
sqlCE ka parin pala...
yaw ng sqlite? for standalone apps..

guide lang ito baka may gustong gumamit ng ce version 4.
sqlite din gamit ko sa mga standalone app project dahil mas mabilis at auto generate ng .db kung hnd existing.