database-connection

Connecting to multiple databases in MVC web application

Hey Guys, How to connect to different databases for a .NET MVC web application written in C#? Here the stucture of the database table remains the same. All that changes is the database name. So how to I manually connect to a database or use modify the connection string? The trick is to use the same code. Depending on the URL I want th...

Visual Studio 2008 adding SQL Server database (SQL Server 2008 Management Studio) not working

I'm trying to practice using the ASP.NET MVC at home, but I ran into an impossible problem. I cannot open a connection to SQL Server 2008, I get this error: "Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. ..." I've googled around for numerous responses, none of them either working or addres...

PDO constructor very slow (mysql)

This bit of code is taking almost a half second to execute. Could somebody help me with some reasons this could be happening and some possible solutions? If it matters, the DB is hosted by amazon rds $this->_connection = new PDO( $dsn, $this->_config['username'], $this->_config['password'], ...

"QSqlDatabase ob" crashes in QT!!!

in my development pc, the line "QSqlDatabase ob" doesn't crash & works just fine. But in a fresh pc moved the exe and it crashed but if i comment the above line and prepare the exe again it runs fine. So I installed things that are required in the fresh pc to run qt from visual studio 2005, just to check whats the problem. Transferred t...

How to handle several DB schemas with Hibernate?

In one of my projects, I have an application that manages several clients (or customer if you prefer). For each of them, I have a dedicated schema on a database. However, the application handles only one client at a time, i.e. the user must switch from one client to another in the application (at runtime, no restart of the application) i...

Firebird, which driver?

Now that I have decided upon Firebird, with the help of StackOverflow :), which driver do you recommend? Delphi's DBX Another vendor's DBX Some native driver Thanks. ...

How do I schedule regular database clean up tasks in Classic ASP?

Hi, I have a Classic ASP site, that requires some database tables to be emptied out of session data on a schedule. This system doesn't have access to scheduled tasks (it's on a shared web host, and using MySQL server) I was considering using global.asa, to fire off events as such: Application_OnStart - delete all session data from d...

How to correctly use ResultSet with h:dataTable

Hey there, The problem is, that after displaying the ResultSet with h:dataTable, the connection is left open. If I close it, it closes the ResultSet too. I'm thinking about copying the ResultSet data into some HashMap/ArrayList combo. Is there a good way to deal with this problem? Thanks in advance, Daniel ...

how to access two different database from single web application

how to access two different database from single web application using asp.net . can u suggest me a solution ...

Open Connection to SQL Compact File, with other Extension than .sdf

I just can't open this connection, if the Extension is different than .sdf. It's there a workaround (Please do not suggest, changing the extension of the File temporarily) ? Thnk u very much. Javier ...

Change subsonic connection string dynamically

Problems Background (you can skip to the question) I have many ASP.Net websites which are same application. different database but same schema, in the same SQL Server. The administration site is already implemented in each virtual directory, and I use subsonic for DAL. http://website1.com/admin http://website2.com/admin http://websit...

Connecting to a Database

This is a relatively simple question but I want to make sure I am doing this the right way. What is the best practice for connecting to a database? This is how I am currently doing it and I want to make sure this is more or less following best practice. private static SQLiteConnection conn; public static SQLiteConnection Conn ...

How to limit the wait time for SqlConnection.Open()?

I want to test if the connection string is correct, so I created a new SqlConnection, called its Open() method. But I have to wait a long time before it returns when the server/data_source part of connection string is wrong. I tried adding connection timeout to the connection string, it didn't work; I tried open the connection in anothe...

JavaScript, asp.net and Sql Server

I know how to use client side JavaScript with asp.net script. But I am unable to figure out how to retrieve data from database and show that data with JavaScript in an asp.net page. Suppose I have written a JavaScript Grid. Then how can I fill that grid with data from SQL Server and show that grid on an asp.net page? That is, how to co...

mysql connection fails after 3000+ attempts

Hi, I was just testing a small script in Prolog to sanity check the MySQL connection. The connection fails randomly, after making around 3000+ connections. Is there any limitation in MySQL Server for number of connections :-dynamic db_connection/1. sanity_check_open_db:- odbc_connect('myDSN', _, [ user(bob), ...

How to connect vb.net to wamp server?

Do you know of any way on how to connect wampserver or phpmyadmin localhost to vb.net. I mean adding, searching, deleting, updating, listing of data from the localhost database via vb.net? ...

Update ms access database via vb.net

How can I do that? I already have the code I'm working on but it seems that it doesnt work really fine. Here is how my program works. I input an id number(unique) on a text box and click the search button. The entries that corresponds to the id number is then displayed on the other text boxes. And then I try to edit one of the entries...

Collating Sequence Not supported by operating system

I am moving from SQL 2000 to SQL 2008. The SQL 2000 is on a Server 2003. SQL 2008 is on a Server 2008. I have imported my database successfully. I am able to perform queries and they work fine. I use a VB6 program running in the IDE to update the database. When my VB6 program runs on a server 2003 the program will connect using the fol...

doctrine path setting.

My mysql connection setting: <?php mysql_connect("fanyer.fatcowmysql.com", "test_username", "test_password") or die(mysql_error()); echo "Connected to MySQL<br />"; mysql_select_db("fanyer_database") or die(mysql_error()); echo "Connected to Database"; ?> This is working perfectly.. Now i am using this in doctrine bootstra...

ADO.NET for oracle doesn't close connections

When connecting to oracle server from .NET application using ADO.NET for oracle, even if i closed the connection, the connection remains inactive at the Oracle server, so new connections could not be established because of the sessions per user limitation, is there is any way to make sure that all connections are closed? from Oracle serv...