.net - Managing Connection To Database In An Asp.net Application?

Mar 17, 2009

what would be the best way to manage a connection to a database in asp.net.My application is built using an N-Tier architecture.The DAL consists of static classes with methods such as

Public Shared Sub Delete( _
ByVal connection As MyConnectionClass, _
ByVal contact_id As Integer, _
ByVal contact_timestamp As Date _

[code]....

The point to note here, is that I pass the connection to the DAL from the BLL.Should I create the connections in the MasterPage, store it in an object, then pass it to my business objects as I create them (the thing I'm trying to avoid)Should I create a connection using a static class and calling a method like CreateConnection on it, from the constructor of my business objects (Something I'd like, but I don't want to have a connection per object, I'd like it to be shared for all instances of my objects, but since asp.net is multi-threaded, a static class doesn't make sense to store connections) the solution should also work well in a Windows Forms environment (So no connection storing in session, and retrieving it with a static method in a class, for the current context)?

View 1 Replies


ADVERTISEMENT

C# - Managing A Debug And Release Connection String

Mar 4, 2010

What is a good approach to managing a debug and release connection string in a .NET / SQLServer application?

I have two SQL Servers, a production and a build/debug and I need a method of switching between the two when my ASP.NET application is deployed.

Currently I simply store them in the web.config and comment one or the other out, however that is error prone when deploying.

View 7 Replies

Managing Multiple Client Socket Connection?

Sep 11, 2011

Am developing a server - client application using the system.net class , that will have more than 5000 simultenous client connection.what is the best way to manage multiple client connection like this?

View 3 Replies

Managing Exception In Multithreaded Application?

Mar 20, 2009

I started throwing exceptions on a multithreaded application, and got a mess.There is a good tutorial on managing exceptions in multithreaded applications?

View 4 Replies

VS 2008 Managing The Users Application Settings?

Oct 28, 2009

I have a simple application with a main form and an options dialogue. The options dialogue has various TextBox's and drop downs where the user can make changes and OK/Cancel buttons for when they're done.On the FormClosing event of the main form, I save these settings to an XML file. When the program is first run, the settings are loaded back into the options dialogue. The application reads settings directly from the controls in the options dialogue during run time.

View 3 Replies

Connection To An Online Access Database From Application?

Jun 8, 2012

I am developing an application on VB.NET 2010, I am planning to make an online activation system, the idea behind is that Whenever someone installs my application, the application presents user an activation form, user will be entering product key, name and email address, and then system will establish a connection to a database which contains all the keys on WEB. So how should I make an efficient program to get rid of that.

View 2 Replies

Hard Coding Database Connection To My Application

Jun 18, 2012

how to hard code my database connect to my application . Example, i want to connect to my application using[code...]

View 3 Replies

Database - Creating And Managing *.db Files

May 26, 2012

I have seen a few .NET apps use .db files. I am not new to Visual Basic, however I have never created a VB app that uses databases. I do know PHP pretty well, and working with databases in PHP I am familiar with.

[Code]...

View 1 Replies

Make Connection Of Window Application To Sql Server Database?

Sep 18, 2009

I am doing a project on window application but the problem is that I want to connect the connection of database to the SQL Server database. Does anyone knows the connection strings of the connection.

View 10 Replies

Securing Connection Using SSL Between Application And Remote MYSQL Database?

Dec 27, 2011

I am building a database application using MYSQL as the backend. The MYSQL instance will be installed remotely on a share host. I have access to SSL certificates. I'm obviously not looking for any code but, conceptually, how do I go about securing the connection using SSL between my application and the remote MYSQL database?

View 2 Replies

Managing Session Timeout In Aspstate Database?

Jun 1, 2009

I am using sql server ASPSTate database for storing session. For testing purpose, I want to set the timeout period of 1 min.

In web.config, I have mentioned sessionState mode = "sqlserver" and timeout = "1"

In Global.asax, in Session_End event, I have redirected to error page.

But Session_End is not firing and hence page is not redirected.

As per my knowledge, The Session_End event is raised only when the sessionstate mode is set to InProc in the Web.config file. If session mode is set to StateServer or SQLServer, the event is not raised.

How can I test session timeout when session mode is set to SQLServer?

Is there any Table/column in ASPState database, where I can change session timeout value ?

I used: Update ASPStateTempSessions set Timeout=1

But still, I cant see session is ending.

How can I test my Session Timeout is working fine or not ?

View 6 Replies

VS 2010 Developing A Chat Application Using Online Connection To A Mysql Database?

Mar 4, 2012

I am developing a chat application using online connection to a mysql databbase. But i am facing a problem. After 10 minutes, MySQL closes all the chat connections because of the 600 seconds timeout (has been set by the host service i am using). I don't understand why is that happening cause every piece of my code which needs data from the database opens and closes the connection (i mean that it dosn't maintain the connection after the query's execution). If i .close() and .dispose() the connection, it still appears in mysql at sleep mode (it terminates only if i exit the program).

Dim MySQLCon as New MySQLConnection
Dim MySQLCom as New MySQLCom
Dim counter as Short

[code]....

View 2 Replies

Create An Application That Connects To A SQL Database To Populate A Datagrid - Getting An Error 'remote Connection Permissions' ?

Sep 25, 2009

I am using VB 2008 Express and have created an application that connects to a SQL database to populate a datagrid.The application is working properly on my computer but will not on others 'remote connection permissions' error.After some googleing I found that the express version is crippled to only work on local machines that use a database.If I purchase Visual Studio 2008 Standard Edition, import and rebuild my application, will my application be able to run properly on other PC's?

View 7 Replies

Copy Opened Database - Application Gets It's Data From A Mdb-file And The Connection Remains Open As Long A Person Works?

May 14, 2010

The fact is I'm making an application, which users can install by using a Setup file...once installed the data in the database can be updated by a centralized server. To do this, they can insert a DVD/CD-ROM and export the necessary data towards it. I need to do it that way, because some of the users who really need this data will be using stand alone computers.The application gets it's data from a mdb-file and the connection remains open as long a person works with the application (maybe not the best way to do, but I know :-) )...when the user uses the application, he can perform an export...this exports the .ini-file and pictures (which works fine), but he also needs to export the mdb behind the application...I already tried connection.close() before and connection.open() after the System.IO.File.Copy...but that doesn't seems to work.

View 2 Replies

Display Connection Properties Dialog For Connection String Browsing(for Database) In Run Time?

Feb 5, 2010

Is there a way to display the connection properties dialog for connection string browsing(for database) in run time?

As I want the user to be able to connect to various database using the GUI.

View 6 Replies

Sql Server - .net Program Dataadapter Connection Closes After Fill But Database Still Shows Connection?

Aug 19, 2010

After running the following sub (VS debugger), I try to detach the database in SSMS, but it shows the connection open still and won't let me detach. If I close program in debugger, the database shows no connections. I check the dataadapter's connection in the finally block and is shows closed. What gives

Private Function ClientMasterDBFiles(ByVal MasterClientDBConnection As String, ByVal DBName As String) As DataTable

[Code]...

View 1 Replies

Database Connection Dll - Error "database Connection Is Not Opened"

Nov 7, 2010

i am using access database for my program. now i have connected to the database in MDI form of main exe, and ir also works, user can log in, it gets verified etc etc etc. now here is the problem, when i load a form from dll and try to use any sql query on that form, i get message, "database connection is not opened". so what i did was, i added the connect() (a function i designed to connect to database) in the load part of the dll's form, it made the trick, query's started to run, everything went fine, and when i reload the form i.e after closing the form, i load it again from MDI form, i get error, connection already open..

[Code]....

View 3 Replies

SQL Connection .net - One Sql Connection Object For The Application?

Jan 27, 2012

SQL connection - I planned to create one sql connection object inside my own singleton class (say connectionmanager with Reference counting for 'SQL connection object' which is a member of the class) and open/close the connection whenever needed. As I like to give high importance for performance. And my application is a desktop based application accessing a remote database server (SQL server 2008), and will use only one connection string, 50 concurrent desktop users may access db server. Please advice.

As like many articles say if the answer is "Connection pooling is taken care by ado.net" - Does that mean that scope of connection pool is entire life of Application instance? Or is it in the scope of SQLConnection object?

View 2 Replies

VS 2008 Database Insert ID Using A OleDB Connection To A Access Database

Jan 2, 2010

I'm using a OleDB connection to a access database. I'm entering a row into the database to set some user preferences. What i need to get is get back the row ID of the row I just entered. I'm more familiar with PHP and with PHP I use use this entry

[Code]...

View 4 Replies

Sql - Copying A Table From One Database Into A Database On A Different Connection (ADO.NET)

Jun 17, 2011

I am trying to copy a table in a database into another database on another connection in VB.NET, using OleDb. If they were on the same connection I would just use SELECT INTO, but they are not. I have two different OleDbConnection and cannot see an easy way to do this.

Right now I am attempting to just copy the database into a DataTable using an OleDbDataAdapter, and then loop through the DataTable and insert every record into the target database one at a time. This obviously takes a ton of time for the large DB I could potentially be dealing with, and I have to deal with escaping strings, null values, etc.

edit - just to make this more clear: I have two OleDbConnection objects, one is linked directly to a local .mdb file on my computer (JET). The other is linked to a database on our servers (SQLOLEDB). I am wanting to do this:

"SELECT * FROM fromDB INTO toDB"

But I can't because fromDB and toDB are on different connections, and the OleDbCommand object is only attached to one. The only way I can see how to do this is to connect to fromDB, copy it into a DataTable, connect to toDB, and copy all of the data in the DataTable row by row into toDB. I was wondering if there is an easier way to do this.

View 3 Replies

.net Application SQL Connection Bottleneck?

Jun 23, 2011

I have a vb.net application that uses a SQL connection to connect to a SQL Server 2008 R2 database. Periodically, users will complain that certain functions in the appliction run slow. This morning a user called while the performance issue was happening. I stepped through the vb code and found it slowed down calling a stored procedure that returned only 1 row. When I executed the stored procedure from SQL Server Management Studio, it returned the row instantly, as expected, but as I stepped through the vb code, it took about 5 seconds for the data adapter to fill the dataset. This performance issue continued in the vb application, but never occurred when executing the procedure from management studio. After 30 minutes or so of me searching for clues, the vb app performance returned to normal and the dataset was filled instantly. What could cause this sort of performance issue that affects the vb app going to the sql server but not going directly to management studio?

View 6 Replies

Connection String In A Application

May 2, 2012

I used to work only with asp.net websites before. I know that in ASP.NET website, the connection string is found in the web.config file. My problem is now I have started working with VB.NET applications which needed to be interfaced to a database. How is a connection string created and where should I put it?

[Code]....

View 4 Replies

DB Connection - Name Application Not Declared

Dec 5, 2009

When I try to make a connection to a db from a service application I get that "Name Application is not declared"
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "
emoteit.accdb;Persist Security Info=False;"
Is this part of Windows.form only?

View 1 Replies

.net - Managing .exe Files?

Sep 7, 2009

In VB.net, how can you programmatically launch a .exe file? Is there a way to check if the file is there?

I know there is some way to check using System.IO, but I have no idea. However, I have not even the slightest clue as to how to launch that .exe if it is there,

View 4 Replies

Managing Combo Box In Different Way?

Oct 12, 2011

In my programme, Student have to select 1 major subject out of 5 subjects and 1 subject for major2 subject our of 4 subjects. And student will have to select 1st major subject according to the preference and will have to select each 4 subjects for major 2 subject against each major 1 subject.as an example if student slect csc for major1 he can select 1st preferce stat , 2nd pref.. maths, 3rd pre.. managment. 4 th pre... eltn for 2nd mejor subject.so, if anyone select one subject for major 1 , I want to remove it from major 2 and display the rest of subject.

cmbBox2.Items.Add("CMIS")
cmbBox2.Items.Add("ELTN")
cmbBox2.Items.Add("IMGT")

[code]......

View 3 Replies

Managing To Get Ip Of A Server?

Jul 5, 2009

I would like to know how I can get a server ip.I have a textbox (textbox1), a label where the ip will be displayed, and a button that will get that information.this code is not related to this but it performs a simmilar action but instead in displays the ping of a given server:

Dim reply As System.Net.NetworkInformation.PingReply
Dim p As New System.Net.NetworkInformation.Ping
Try

[code]....

i want to use the same textbox to get ping and ip of a given website triggered by the same button.

View 5 Replies

Sql - Ado.net Managing Connections

Jun 6, 2010

I'm populating a listview with a list of databases on a selected SQL instance, then retrieving a value from each database (It's internal product version, column doesn't always exist) I'm calling the below function to populate the second column of the listview:

[Code]...

View 2 Replies

Set A Database Connection?

Mar 22, 2010

I am trying to change my windows application I made in vb.net that uses an access database. I do not know where this database will be stored at this time so my plan is to set the connection using code based off a text file that points to the location of the database. Here is the code I have but I know there is something wrong with my syntax because it putting "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|IWS.mdb" in both the data source and the database name.[code]...

View 14 Replies

VB Connection To Database?

Feb 26, 2010

i am an IT student and i want to understand very well how to program in visual basic.net and how to manipulate its connection to database since my project uses visual basic environment.

View 1 Replies

Can Proxify Application's Connection To The Internet

May 1, 2009

is there a way I can proxify my application's connection to the internet??

I want it to be able to select a random proxy from a list of proxy IP address in a text file.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved