SQL Server Connection Pooling (ADO.NET) Inactivity Period?
May 19, 2012
What does "inactivity" means related to SQL Server Connection Pooling (ADO.NET) Is it decided based on time ?If yes, then how to get the limit? and what happenes when the inactivity limit reached?
View 3 Replies
ADVERTISEMENT
Jan 12, 2010
I'm trying to connect a remote mysql database. I'm doing it from a vb.net 2005 application with a connector mysql.data.dll What's happening is, suppose if I try to connect thrice it connects twice and once throwing an exception that says A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. there's nothing wrong with the code, otherwise it would never have connected
View 4 Replies
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
Jun 29, 2010
I've got an app using .net UIAutomation, it eventually runs out of memory and crashes just monitoring windows being shown and closed. Seemed easier to show this in VB than C# but happens the same either way. It appears to be a leak/pool in the underlying proxy objects. Most of the memory is not being shown as in use as .net memory.
[Code]...
View 1 Replies
Jan 9, 2012
I am working on completely redeveloped website and sales system and have come up against this Max_connections issue surprisingly quickly.Closing/Pooling MySQL ODBC connections Recently, but have since tried a few other things, still drawing a blank, but have more detail to offer...I have a built a pretty complex sales process, and in creating an invoice I seem to be leaving 7 "processes" running each time. I have counted the number of times the data connection is used during the process of creating an invoice, and it is 7-9 depending on a few conditional values, so effectively the data connections are not closing at all.To try to speed up coding, I have made a couple of functions which handle my database connectivity, so I will post these below.
Firstly, my connection string is:
"DRIVER={MySQL ODBC 3.51 Driver}; SERVER=mysql.dc-servers.com; DATABASE=jamieha_admin; UID=USERID; PASSWORD=pWD; OPTION=3;pooled=true;Max Pool Size=100"
The functions which I am using to open and close and do stuff with the database are as follows:
Function connectionString(sql As String, closeConnection As String) As OdbcConnection
Dim DBConnection As String = ConfigurationManager.ConnectionStrings("dbConnNew").ConnectionString
'this is getting the connection string from web.config file.
[code]....
I am not sure whether making all these functions is making my life easier or harder, but I was trying to reduce the code in each file where data acceess is required, but I'm not convinced it has.However, it has made it clear where and when I am opening and closing the database (or at least trying to)The processes are not being closed though. If I run my sale process through 3 or 4 times in quick succession, with these 7 processes still being live and added to, I get the max_connections issue.
a) Is my connection string correct, is there a better connection available for MySQL?
b) Using this method, creating a ODBCConnection Object, is it possible to close it within a function like this?
c) Why is (CommandBehavior.CloseConnection) not closing the connection (this problem arose before I tried closing the connection manually)
View 1 Replies
May 14, 2010
This will happen at random, and I can always just catch the error and re-establish connection to the server, but I am confused as to why. When doing lots of inserting into the sql server, I only establish one connection that is public, instead of many little connections. I had my doubts on a public sql connection, but it's been running great, and I've seen no problems until this morning. Again, this random moment I hit an error that stated, sql connection state is broken. Is it bad practice to just accept this error, and when it happens, re-establish the connection?
View 7 Replies
Feb 23, 2009
"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding." why i am getting this error message in the loop for the first row its works perfect but when it goes next in the loop and then it call again the function chkexist it gives the massege same error on call the nxtno function
[Code]...
View 3 Replies
May 3, 2011
I'm not sure if this is a VB.NET error or SQL Server. But I get the above error with following stack trace:
[SqlException (0x80131904): Timeout
expired. The timeout period elapsed
prior to completion of the operation
or the server is not responding.]
System.Data.SqlClient.SqlConnection.OnError(SqlException
[code]....
View 3 Replies
Jun 6, 2012
I've got a DGV and a timer, I want to hide the DGV after 15 minutes of inactivity on my form. How can i do this? I've got a number of other controls (textboxes, buttons etc).
I thought somehow I could reset my timer every time a mouse moved on my form but would this create to much running on the mouse code when a user moved the mouse on my form?
View 1 Replies
Nov 28, 2009
This emailing code wont seem to work in my program. I get an exception "The SMTP server requires a secure connection or the client was not authenticated. The server response was 5.5.1 authentication required."
Imports System.Net.Mail
Public Class emailStudent
Private Sub sendEmailButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sendEmailButton.Click
SendMail()
[code]....
View 12 Replies
Aug 18, 2009
I have simple code that connects to Sql database... (well it doesn't)
VB
Dim objConn As New SqlConnection("Server=localhost;uid=***;pwd=***;database=***")
objConn.Open()
ERROR MESSAGE:A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)But looks like something is wrong with "localhost" thing. Any help? Where can I get name of (my) server?
View 34 Replies
Jul 21, 2010
I am working on uses the ThreadPool class and specifically the QueueUserWorkItem method to launch its background tasks. I am however having an issue related to SqlConnection timeouts. My error is this: "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached."
This code is using all available ThreadPool threads because it is processing nearly 100,000 items, each on a threadpool thread, and updating an SQL database. So my question is this? Has anyone ran into a similar problem or could shed some light on a resolution to this issue? In testing, if I use the threadpool. setmaxthreads function and give it a value of 100 (to match the default Sql connection pooling count) then all runs just fine, but much to slow to process this much data.
[Code]
View 5 Replies
Feb 29, 2012
I am tring to make the below application work with SQL Server 2005 Database Currently it works for test.mdb, which is in the same folder with the application. How shoud I modify the MapPath to work with SQL Server.
[Code]...
View 1 Replies
Sep 7, 2009
As I've noted in another thread I'm trying to put together a secured kiosk app for access to our college library catalogue.I've managed to do most of the stuff with little fuss but, given that I'm not much of a programmer, I'm having a bit of trouble with certain features I'd like to incorporate.One of them is that I'd like the webbrowser control to return to the components designated homepage after 5 minutes of inactivity.
View 2 Replies
May 5, 2011
I'd like to find a tutorial that shows how to logout after a certain period of inactivity.By logging out, i mean writing a Row to my SQL database. The database table was designed with a column called user_status. When a user logs in, ASP writes a row called "logged in" into the database table. I want to find an automatic mechanism that writes a Row to the database after a certain pd of inactivity
View 2 Replies
Apr 26, 2011
Title says it all "Detecting internet Inactivity in VB.NET"
View 1 Replies
Jul 30, 2011
PROJECT TYPE: Windows Forms Application
LANGUAGE: Visual Basic
.NET VERSION: 3.5
IDE: Visual Studio 2008
OPTION STRICT: on
OPTION EXPLICIT: ON
I am developing a parental control application containing a feature that logs a user off of the computer after an administratively set period of time. I do not however want the application to continue counting time against the time limit when the user is not active on the computer. EXAMPLE: Child logs on and is active for an hour then leaves computer for 45 minutes to get dinner. The session timer needs to ignore the 45 minutes of inactivity. I have thought of two ways to accomplish this.
1) Use a SystemEvents.SessionSwith event (to detect the Start Menu > Log Off > SwitchUser action), or
2) Use an event which would detect user inactivity in excess of a set time, e.g. 5 minutes (similar to a screensaver).
Either event would call a method which would simulate a pause feature (as StopWatch and Timer have no pause support that I know of). I believe the 2nd option would prove to be more universally affective as 1) some users do not have Fast User Switching enabled, and 2) users would be required to manually switch users in order to prevent their inactive time from counting against them. My problem arises when I attempt to implement one of these methods. According to the IntelliSense error checking engine, I have absolutely no clue how to do either of these tasks in spite of the research I have conducted on the topic. I would prefer to go with the system idle time approach.
View 6 Replies
Aug 13, 2010
I am trying to do something fairly simple.. allow my user to import thier data from Excel into SQL Server, where it can be used by the application.To do this, I'm using the fairly simple code that is common everywhere I look:
strFilePath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fdlgFileOpen.FileName + ";Extended Properties=Excel 8.0"
connExcel = New OleDbConnection(strFilePath)
connExcel.Open()
[Code]...
Now, on my development computer this code works perfectly. The data imports, and I can go on my merry way.
On the TEST computer, this code throws the error: "ODBC -- Connection to {SQL Server} servernamesqlservername failed." This seems very odd to me, because I'm using exactly the same SQL Server and database to interact with the application, and all the other screens in the application work perfectly. The test computer CAN connect to this SQL Server, but it keeps throwing this error whenever I try import data from Excel.I've tried everything I can think of - using the server's IP address instead of the server name, sending the SQL Server administrator data along with the request, taking out the Trusted_Connection=Yes... nothing works. What is going on here? How can this code work fine on my computer, and hiccup on another?
View 1 Replies
Jun 21, 2010
i started programming with .NET (i have express edition) and wanted to make a connection to an SQL Server..previously i had .net 2005 - i started having the issue there - i unistalled it, n installed visual studio 2008. I have installed SQL Compact that came with the .net 2008, and besides it SQL Server 2000.When I try to make a connection to the SQL Server, if server is running I have to stop it and then choose the DB i want to use. (if its running wont let me choose any DB). Then, when i select the DB i need, Im getting this error:
"The instruction CREATE FILE fount SO error 5 (failed to retrieve text for this error.Reason:15105) while trying to open or creating the fysichal file : -path- to northwnd_log.ldf. Cant open the new database -path to northwnd.mdf. CREATE DATABASE discarded.Error while trying to attach a DB automatically named for archive -path to northwnd.mdf. There already exists a database with the same name, cant open the specified file or it is in a shared UNC resourse.File activation error. File name -path to northwnd_log.ldf- might be wrong"And when i try to connect with the SQL compact edition that came installed with the visual studio, im getting this error:"Can not allow access to the file in DB [File name = path to northwind.sdf]"
View 14 Replies
May 30, 2010
I have many Listviews in my Form and Im retrieving stored procedures to populates my Listviews. Is it necassary to close the connection to SQL Server once I have finished populating my Listviews?The angle which im coming from is that every 30 seconds or so I need to re-populate my Listviews with the latest cut of data from SQL Server therefor Im probably going to slow down my application if it has to connect to SQL Server every 30 seconds to get the latest cut of data... instead of keeping the connection to the SQL Server Stored Procedure live so that I can use some sort of method to refresh the data?
View 2 Replies
Mar 14, 2012
why i'm getting the following error from the code below:
Error Type:
Active Server Pages, ASP 0221 (0x80004005)
The specified 'Import Namespace="System.Data.OleDb" ' option is unknown or invalid.
/default.asp, line 6
[Code].....
View 6 Replies
Sep 18, 2011
I've been trying to make a login system for my application. Which seems to work, but when I try to connect to the database itself, it won't work. I used this code to check the exception:
Catch myex As MySqlException
MsgBox(myex.Message)
That gives this exception:
"Acces denied for user '[my db user]'@'[My IP-Address]' (Using Password: YES)"
The code I use for the connection is:
Dim Connection As New MySqlConnection("server=[The SERVER IP]; user id=[DATABASE USER]; password=[DB USER PW]; port=3306; database=[DB NAME]; pooling=false")
Connection.Open()
MsgBox("Connected")
As you can see, I've tried to change the 'server' part, but it won't affect anything. It will just say my ip address (localhost, I assume) in the exception. Telling me that it couldn't connect to it. Which is not even what I'm wanting to do.
View 7 Replies
Nov 15, 2011
I'm using Visual Studio 2005 and SQL Server 2000 for my vb.net desktop application..I'm having a SQL Server exception saying that "connection can't be established to the server.hen connecting to SQL Server 2005 this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. Also showing
View 2 Replies
Apr 19, 2012
I have installed sql server 2005 in my machine which is installed vb.net 2008. I want my machine to distribute the database to the clients and make it as server.I don't have that much knowledge of how to overcome this issue as i am awfully naive about it.Let me start it here:I have got an application in vb.net...at first i was using ms access database 2007. then decided to switch on to the sql server since i want to distribute the database to the clients who are going to use my application.When i installed the sql server, i imported my access db files onto sql server database. i enabled tcp/ip as enable in the sql server network Configuration. i want use sql server windows authentication as my default user account of my system for the sake to simplify the issue.
Hence, i connected the sql server into the vb.net through the "add new data source".am done with that...the problem is how do i assign the connection string to the vb.net? Or how do i include a connection string in vb.net which tells every other computer that the database data source is in my computer so that every computer can automatically check it in the network.Where exactly shall i put the connection string...as far as my knowledge is concerned for access database, you can easily identify your connection string in project /properties/settings...it goes here and you put your database in any where.And what is the best connection string do i need for sql server 2005..computers are running windows xp.
View 8 Replies
Feb 26, 2009
I making a connection through word 2003 VBA to SQL server 2005 using the following codeDim cn As ADODB.ConnectionSet cn = New Connectioncn.ConnectionString = "Provider=SQLNCLI;Server=LEXAE29150SQLEXPRESS;" & _"Database=MCarter.mdf;Integrated Security=SSPI;"cn.openetc.cn.close.All runs fine up to cn.open.I then get the message error 'Cannot open database "MC.dbf" request by the login. The Login failed'.Tryed websearching but no succes. Been on it a week and the boss is doing his nut. I'm lost and unsure what wrong.The SQL server is set for windows authenticity and SOL Server login.In the MC database under security users my user name (Login) is their and setup as owner and sysadmin.SQLServer is running on the same machine as the word.dot.
View 3 Replies
Oct 6, 2011
I using vb.net 2010 and sql server management express 2008. bu I little confused what is wrong with the code for connect sql and vb.net
[Code]...
View 2 Replies
Nov 26, 2008
how to use conection with vb.net 2005 and ms access and also sql server
View 3 Replies
Aug 12, 2010
I am wondering if it is possible to perform some SQL command on a datatable. I currently have an application which reads in an excel spread sheet using the excel COM, and stores the data in a object array. The Object array is then used to create a datatable based on user specifications. I have added a number of checked list boxes which are populated with the column names and row number. The user can select what rows and columns that want to see, and the datatable is recreated to their needs and displayed in a datagridview.
Although at the moment the program is fairly simple in design, but I plan to add a bit to it. I am now wondering if you can use an SQL statement to extract a set of data from a pre-existing datatable. Most examples I have seen involve a connection to an SQL server,
View 2 Replies
Mar 20, 2012
I have SQL Server 2008 setup to remote connection. and it works perfect. I can access it from public IP address. [code]...
View 7 Replies
Feb 26, 2012
I'm trying to run this code, but it displays the error "overload resolution failed".
[code...]
Here is the full error:[code...]
View 1 Replies