User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 402,699 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,428 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 316 | Replies: 2
Reply
Join Date: Mar 2008
Posts: 7
Reputation: prabhuraj is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
prabhuraj prabhuraj is offline Offline
Newbie Poster

how to add database into the while iam deploying.

  #1  
Apr 24th, 2008
may i know how to add sqlexpress database to my visual studio project while iam deploying...
(i tried by simply adding database into my project through solution explore before deploy , but while instaling deployed project into client machine ,on that time i cant access the data's from database.)
can you tell me how to do this process in detail.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2008
Location: Belgium
Posts: 47
Reputation: Jens is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
Jens's Avatar
Jens Jens is offline Offline
Light Poster

Re: how to add database into the while iam deploying.

  #2  
Apr 24th, 2008
Try to put your connectionstring in a config - file. This way you'll be able to edit it specifically for the machine you want to install it on.

In you config- file it should look a bit like
  1. <connectionStrings>
  2. <add name="nameconnstring" connectionString="connstring" providerName="System.Data.SqlClient">
  3. </connectionStrings>

I think.
In your program you'll have to reference the system.configuration library. After that you can retrieve the whole connectionstring with:
  1. static String ConnectionString = ConfigurationManager.ConnectionStrings[<name or index>].ToString();

Hope this helps, jens
Last edited by Jens : Apr 24th, 2008 at 3:57 am.
Reply With Quote  
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 279
Reputation: JerryShaw is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 38
JerryShaw JerryShaw is offline Offline
Posting Whiz in Training

Re: how to add database into the while iam deploying.

  #3  
Apr 25th, 2008
Is the database getting installed ? IOW can you access it using SQL 2005 Studio on the client machine ?

If this is a question about connection strings (IOW the database is verified to be installed on the client and functional), then "Jen"'s answer should be all you need.

If your question involves the installation of the database on the client computer then read on:

If this is an SQL database, I suggest that you use an install package that knows what it is doing with SQL.

Typically using a T-SQL script has a better success rate, however if you know what you are doing, you can use the Attach datebase functionality of T-SQL (through ADO...other). The issues there are that you must make sure you have no special schemas created (created against a non existing user) , Simple file structure (aka not using FileGroups / database partitioning) and no database users assigned where the SID will not match.

// Jerry
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C# Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the C# Forum

All times are GMT -4. The time now is 5:44 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC