473,379 Members | 1,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Dynamically sql connection

hi i`m using visual basic express 2010 and SQL server 2008 R2 this is my problem i create database in sql, then i connect to database by visual basic. like

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <configuration>
  3.   <configSections></configSections>
  4.   <connectionStrings>
  5.     <add name="WindowsApplication1.My.MySettings.BPdataConnectionString"
  6.       connectionString="Data Source=.\SQLBAC;AttachDbFilename=G:\SQLSERVER\MSSQL10_50.SQLBAC\MSSQL\DATA\BPdata.mdf;Persist Security Info=True;User ID=sa;Password=martin;Connect Timeout=30;User Instance=False"
  7.       providerName="System.Data.SqlClient" />
  8.     <add name="BPdataEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLBAC;AttachDbFilename=G:\SQLSERVER\MSSQL10_50.SQLBAC\MSSQL\DATA\BPdata.mdf;Persist Security Info=True;User ID=sa;Password=martin;Connect Timeout=30;User Instance=False;MultipleActiveResultSets=True&quot;"
  9.       providerName="System.Data.EntityClient" />
everything is working but if i will use it in other PC then database directory and SQL server name will be different... so i need to ask program before start for server name, database name...
Jan 6 '11 #1
0 1048

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
1
by: Tim Nelson | last post by:
I am building a data bound application for SQL server which all the forms I use sqlconnections generated by VS. I want to have a login form that changes the connection depending upon login...
3
by: JJ | last post by:
Hello, I was wondering what the best way would be to dynamically determine and store connection string information. What I mean by this is that I want the application to user the servervariable...
1
by: stewart | last post by:
I've got the standard SqlCacheDependency working just fine , ie. I've defined (and encrypted) the connectionStrings section in the web.config, and I've also defined an an sqlCacheDependency in the...
2
by: Henry | last post by:
I want my VB.Net windows application to be able to dynamically switch to either a Production environment or a test environment. Currently my SQL Connection string is hard coded in the data adapter...
37
by: sam44 | last post by:
Hi, At startup the user log on and chooses the name of a client from a dropdownlist, which then changes dynamically the connection string (the name of the client indicates which database to use)....
7
by: Larry Neylon | last post by:
Hi there, We are in the process of implementing Membership and Role Management and have a problem with the connection strings in our web.config. We currently have a system that on...
11
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Is there a way in ASP.NET 2.0 to have different connection strings settings in a web.config files that are dynamically used based upon the server that the web application is running on? For...
1
Merlin1857
by: Merlin1857 | last post by:
How to search multiple fields using ASP A major issue for me when I first started writing in VB Script was constructing the ability to search a table using multiple field input from a form and...
2
by: Austin326 | last post by:
Hi Everyone, I have a problem that is quite frusturating. I am passing in an image from a database, which is to be accessed in an image button. When I dynamically add the string for an sql...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.