how to add database into the while iam deploying.

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 7
Reputation: prabhuraj is an unknown quantity at this point 
Solved Threads: 0
prabhuraj prabhuraj is offline Offline
Newbie Poster

how to add database into the while iam deploying.

 
0
  #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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 47
Reputation: Jens is an unknown quantity at this point 
Solved Threads: 5
Jens's Avatar
Jens Jens is offline Offline
Light Poster

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

 
0
  #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 4:57 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 436
Reputation: JerryShaw is on a distinguished road 
Solved Threads: 72
JerryShaw JerryShaw is offline Offline
Posting Pro in Training

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

 
0
  #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 Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC