.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Easy Web
Imran Ghani

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Local Database attachment in Windows Application

Posted By: Hary     Posted Date: July 11, 2011    Points:5   Category :C#
Hi All

i want to attach local database ie Database.sdf in my windows application but i am not able to get the connection.
Please tell me any solution?

my connection string is given here:

String connectionString = "Data Source=|DataDirectory|\\Database1.sdf";

Author: Ravi Ranjan Kumar             
Posted Date: July 11, 2011     Points: 20   

go there

Thanks & Regards
Ravi Ranjan Kumar
Author: Narayanan             
Posted Date: July 12, 2011     Points: 20   

Data Source=" + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\DatabaseName.sdf;Persist Security Info=False;

Regards, Lakshmi Naraayanan.S
Author: Gowthammanju             
Posted Date: July 13, 2011     Points: 20   

Hey in tools u have option as connect to database

den u fill some necessary details fo server name and database finally click advanced button u will find connection string der

Thanks & Regards,

Mark if the answer is true

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend