•
•
•
•
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
![]() |
•
•
Join Date: Mar 2008
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 0
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.
(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.
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
I think.
In your program you'll have to reference the system.configuration library. After that you can retrieve the whole connectionstring with:
Hope this helps, jens
In you config- file it should look a bit like
xml Syntax (Toggle Plain Text)
<connectionStrings> <add name="nameconnstring" connectionString="connstring" providerName="System.Data.SqlClient"> </connectionStrings>
I think.
In your program you'll have to reference the system.configuration library. After that you can retrieve the whole connectionstring with:
c# Syntax (Toggle Plain Text)
static String ConnectionString = ConfigurationManager.ConnectionStrings[<name or index>].ToString();
Hope this helps, jens
Last edited by Jens : Apr 24th, 2008 at 3:57 am.
•
•
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 279
Reputation:
Rep Power: 2
Solved Threads: 38
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
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
age amd avatar backup blue gene breach business chips daniweb data data protection database development dos economy energy enterprise europe government hacker hardware hp ibm ibm. news intel ibm it linux medicine memory microsoft news open source openoffice pc ps3 recession red hat russia security server sql sun supercomputer supercomputing survey technology trends ubuntu working x86
- Previous Thread: regular expressions
- Next Thread: <Help!!> I need to retrieve an autonumber from microsoft access using visual C#


Linear Mode