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


Top 5 Contributors of the Month
david stephan

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Database Connectivity

Posted By: Ruchi     Posted Date: March 12, 2010    Points:2   Category :VB.Net
Hi ..

How can i set path of Database file which is currently placed in my Project's Database folder in Global connection String defined in Module? I do not want to use an DSN connection so any alternate to that ?

Responses
Author: Lalij Mer             
Posted Date: March 12, 2010     Points: 5   

you will get here


http://visualstudiomagazine.com/articles/2004/07/01/create-a-dsnless-database-connection.aspx

Please Check my answer if you help....
Thank You...

Lalit.
Author: Syed Shakeer Hussain             
Posted Date: March 13, 2010     Points: 5   
Author: balram             
Posted Date: March 15, 2010     Points: 5   

Hi..

if your database is placed in app_data folder of you main application and suppose you database file name is test.mdb then you can write
Application.StartupPath + "app_data\test.mdb"

but you have to place this folder in you bin folder of application for running bcoz when you run the application from IDE application.startup path return you bin folder path where you exe is build.
after deploying setup it works fine.

thanks
balram

Author: Ruchi             
Posted Date: March 15, 2010     Points: 5   

Thanks
i shall try your solution.

Author: duraikannan             
Posted Date: December 14, 2010     Points: 5   

DataBase Connection String:

Dim SqlConn as new SQLConnection("Server=ServerName;Database=DbTest;UID=sa;Pwd=test")
SqlConn.Open()




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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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