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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Dynamic DB Connection

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :ASP.Net

Hi All,

How to handle the DB Server connection depends on client?

for eg. for a product based application one client wants sql server DB and another one wants oracle DB.

few days later if anyone wants mySql DB, then how we can maintain connectionstring in web.config dynamically?

let me know how we handle or best way to handle without changing the application code.



View Complete Post

More Related Resource Links

I need a dynamic connection string for my windows forms application.


Hello folks


I am brand new to forms applications and visual studio 2008 I am building a forms application to connect to a 3rd party's sdf file. There is no password or username required to connect however the 3rd party app installs the sdf in the users folder for me I am on windows 7 but I have clients on xp.


I went to add a data connection and chose sql ce file and browsed out to my location and it connects and works. But I need this connection string to be for whoever is logged into there laptops or computers no matter the operating system version xp,vista,7.


Data Source=C:\User\username\AppData\Roaming\PS\GES\surve.sdf


Can someone tell me how to do that. Also please explain in words a new borne could understand cause like I said I am new to this.


Thank you


JDBC Connection using Dynamic Ports


I have a sql cluster running 3 instances.One of the user is trying to connect to these instances using JDBC connectivity.We have configured to use Dynamic ports so the url with the default port is not working for us and I cannot change the port.Can you please plese let me know the URL for this.Also on the Surface Area Configuration Manager I sec Client Protocols ,How is this different from the Protocols for each instance.




SSIS Dynamic Connection Provider



I am working on SSIS 2008. My requirement is that I need to connect to SQL Server or Oracle datbase in lookup, but I will get to know this at runtime whether its SQL Server or Oracle. So one option is to create separate connection for each and use separate lookups. But my question is can I use only one connection and one lookup and achieve this? I short can I can change oledb connection provider at runtime?




Is a Dynamic Config Possible for SSAS BIDS Projects? (Data Source / Connection, and Deployment Targe


How do we automate SSAS Project configs such that (a) RDBMS data source server (connection) and (b) SSAS deployment target server are dynamic? 

As it stands, just before I script the ASDB (for deployment/promotion from Dev to QA, or QA to Prod, for example), I use BIDS designer interfaces to change the source connection and deployment targets, then script the ASDB. 

Is there a more dyamic alternative?  Perhaps something analogous to SSIS package configurations?  I can't believe that everybody is doing this as manually as I've done.

Change Dynamic Data database connection string


I have recently started to learn Dynamic Data Web application.

I have built a Dynamic data Website with LINQ data access layer. When the LINQ data context was built over an existing SQL2005 database, the connection string for that database was correctly, automatically, placed into the Settings and .edmx Code for the project. It works, but it's a "static" connection string.

I would like to be able to use this one LINQ data access layer against both test and production databases without having to manually change and recompile the project's connection string each time.

Is there a way to pass/change the User connection string to the LINQ data access layer at Run Time so that destination database changes? Ot in Other words How can user can choose a database from a list of databases.


Excel Connection Manager DYNAMIC


Hi Experts,

I have Excel Connection Manager's Connection String as:-

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\TEMP\ABC.xls;Extended Properties="EXCEL 8.0;HDR=NO";

But I want to make it dynamic by using my Package variable something like this:-

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\TEMP\+@[User::FileName]+;Extended Properties="EXCEL 8.0;HDR=NO";

But it is giving me error, so to change Excel Connection Manager connection string to make it dynamic?

Any Help




Login SQL Server with Dynamic Code and block SSMS remote connection


Dear all,

- Can we configure SQL Server login integrated using Dynamic Code (TOKEN) ?

As far i know , we can use Dynamic code / Token with Login Windows, but i dont know about Token/Dynamic Code with SQL Server login.

- and can we block SSMS Remote connection, so we cannot connect using SSMS /Query analyzer to the server. The only way is local connection.

thanks in advance

Our Environments :
-SQL Server 2K8EE integrated with LUna HSM & RSA

-Win Server 2k8EE


Regards, Mathias.Arya

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Dynamic Data Templates in GridView ASP.NET 3.5

At a high level, Dynamic Data Templates can be seen as a system to very quickly build up a User Interface linked with the relevant data model, immediately enabling you to perform CRUD operations (Create, Read, Update, Delete) on the database using the specified data source. They provide a powerful method for building up these kinds of applications, and I'm going to focus on an overview of what Dynamic Data Templates actually are, and a few ways of customizing them to suit industry needs.

ASP.NET 4.0 Dynamic Data and Many to Many Entity Framework Entities

I did not play much with Dynamic Data controls in VS2008 and just made a cool discovery in VS2010 Beta 2. This may not even be new, but as I'm sitting 30,000+ feet over the Atlantic ocean, I don't have access to VS2008 at the moment to check.

Dynamic Systems Development Model (DSDM) Methodology

The Dynamic Systems Development Model was developed in the U.K. in the mid-1990s. It is the evolution of rapid application development (RAD) practices. DSDM boasts the best-supported training and documentation of any of the agile software development techniques, at least in Europe. DSDM favors the philosophy that nothing is built perfectly the first time and looks to software development as an exploratory endeavor.

Adding Dynamic Rows in GridView with TextBoxes

I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Adding Dynamic Rows in GridView with TextBoxex in C#

I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

What is the difference between "dynamic" and "object" keywords?

Let's take a quick look at the object keyword first. I'm not going to talk a lot about it because it's been around since C# 1.0. This keyword is nothing more than a shortcut for System.Object, which is the root type in the C# class hierarchy. (However, as Eric Lippert pointed out in his blog post, not everything in C# derives from object.) This is a powerful mechanism, since you can assign almost any value to instances of this type.

Dynamic in C# 4.0: Introducing the ExpandoObject

You have probably already heard about the new dynamic feature in C# 4.0 and how it is used to support COM interop. If you haven't, I strongly recommend reading the following MSDN articles: Using Type dynamic and How to: Access Office Interop Objects by Using Visual C# 2010 Features.

SQL Connection String

We can learn or know how can we connect the database from our .net. This will help for freshers or .NET beginners!

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

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