Can't Connect To DB When SqlServer Exp Has Been Idle For A Couple Hours.
Mar 13, 2008
Does SQLServer go to sleep when it's been idle? How can I connect without an error?
I have SQLExpress on a server. Server Name is SqlExpress. I have 2 DBs on that server... Tuna & Guppy. I'm connecting to the DBs from a remote PC which runs my App... an exe created with Visual Studio 2008, Visual Basic.
If I run my App at say 9:30PM, after the server has been idle for several hours, I get a "Can't open connection to Guppy" error, which is my error message when the connection attempt fails. If I quit & relaunch the app, it connects fine, and will continue connecting fine unless you leave the server idle for serveral hours again.
If I'm developing a 2nd app all evening... which connects to a 2nd DB...Tuna, that activity seems to keep the SqlServer awake and then launching the 1st app at 9:30PM connects to Guppy just fine.
I tried adding a "Connection Timeout=30" to my connection string but that did not help.
My connection code is as follows (note the server's name is SQLExpress):
Dim strConnG As String = "Data Source=SQLEXPRESSSQLEXPRESS;Initial Catalog=Guppy;Integrated Security=True;Connection Timeout=30"
Using ConnG As New SqlConnection(strConnG)
'open Guppy connection
Try
ConnG.Open()
Catch ex As Exception
MsgBox("Can't open connection to guppy")
Return False
End Try
'Code that does stuff
End using
Can anyone tell me how to fix this so I can connect without error, even if the server has been idle?
Thank you,
Joe A
View 6 Replies
ADVERTISEMENT
Apr 22, 2015
I want to display Days Hours Mins Format.
I am Having two columns Like below,
Col1 (in days) Â Â col2 (In Hours : Mins)
3days 4:5Â
In this first have to  add Col1 and Col2 (Here one day is equals to 9 hours ) so the addition is 31.5
From this 31.5 I should display 3 Days 4 Hours 30 Mins because 31.5 contains 3 (9 hours) days 4 Hours and .5 is equals to 30 mins.
View 6 Replies
View Related
Sep 21, 2006
I have data coming from a telephony system that keeps track of when anemployee makes a phone call to conduct a survey and which project numberis being billed for the time the employee spends on that phone call in aMS SQL Server 2000 database (which I don't own).The data is being returned to me in a view (see DDL for w_HR_Call_Logbelow). I link to this view in MS access through ODBC to create alinked table. I have my own view in Access that converts the integernumbers for start and end date to Date/Time and inserts some otherinformation i need.This data is eventually going to be compared with data from someelectronic timesheets for purposes of comparing entered hours vs hoursactually spent on the telephone, and the people that will be viewing thedata need the total time on the telephone as wall as that total brokendown by day/evening and weekend. Getting weekend durations is easyenough (see SQL for qryTelephonyData below), but I was wondering ifanyone knew of efficient set-based methods for doing a day/eveningbreakdown of some duration given a start date and end date (with theday/evening boundary being 17:59:59)? My impression is that to do thiscorrectly (i.e., handle employees working in different time zones,adjusting for DST, and figuring out what the boundary is for switchingfrom evening back to day) will require procedural code (probably inVisual Basic or VBA).However, if there are set-based algorithms that can accomplish it inSQL, I'd like to explore those, as well. Can anyone give any pointers?Thanks.--DDL for view in MS SQL 2000 database:CREATE VIEW dbo.w_HR_Call_LogASSELECT TOP 100 PERCENT dbo.TRCUsers.WinsID, dbo.users.username ASInitials, dbo.billing.startdate, dbo.billing.startdate +dbo.billing.duration AS EndDate,dbo.billing.duration, dbo.projects.name ASPrjName, dbo.w_GetCallTrackProject6ID(dbo.projects.descript ion) AS ProjID6,dbo.w_GetCallTrackProject10ID(dbo.projects.descrip tion) AS ProjID10,dbo.billing.interactionidFROM dbo.projects INNER JOINdbo.projectsphone INNER JOINdbo.users INNER JOINdbo.TRCUsers ON dbo.users.userid =dbo.TRCUsers.UserID INNER JOINdbo.billing ON dbo.users.userid =dbo.billing.userid ON dbo.projectsphone.projectid =dbo.billing.projectid ONdbo.projects.projectid = dbo.projectsphone.projectidWHERE (dbo.billing.userid 0)ORDER BY dbo.billing.startdateI don't have acess to the tables, but the fields in the view comethrough as the following data types:WinsID - varchar(10)Initials - varchar(30)startdate - long integer (seconds since 1970-01-01 00:00:00)enddate - long integer (seconds since 1970-01-01 00:00:00)duration - long integer (enddate - startdate)ProjID10 - varchar(15)interactionid - varchar(255) (the identifier for this phone call)MS Access SQL statement for qryTelephonyData (based on the view,w_HR_Call_Log):SELECT dbo_w_HR_Call_Log.WinsID, dbo_w_HR_Call_Log.ProjID10,FORMAT(CDATE(DATEADD('s',startdate-(5*60*60),'01-01-197000:00:00')),"yyyy-mm-dd") AS HoursDate,CDATE(DATEADD('s',startdate-(5*60*60),'01-01-1970 00:00:00')) ASStartDT,CDATE(DATEADD('s',enddate-(5*60*60),'01-01-1970 00:00:00')) AS EndDT,DatePart('w',[StartDT]) AS StartDTDayOfWeek, Duration,IIf(StartDTDayOfWeek=1 Or StartDTDayOfWeek=7,Duration,0) ASWeekendSeconds,FROM dbo_w_HR_Call_LogWHERE WinsID<>'0'
View 3 Replies
View Related
Oct 16, 2007
i can't connect sqlserver from client pc
please help me >>>>>>>>>>>>>>>>>>
hi all
View 1 Replies
View Related
Feb 17, 2006
when sqlcmd -s serverinstance cmd is given it geves an error that "under default settings sql server does not allow remote connections login timeout expired"
why sql browser not running
pls help
View 1 Replies
View Related
May 14, 2007
After several attempts to install SQL2005 I finally got Microsoft SQL Server Management Studio installed.But now I get the error below:An error has occurred while establishing a connection to the server. When 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. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)The sa account username/password are correct and don't work, windows authentication does not work, I have stopped/started all the services, I have all Protocols enabled correctly, I have my Firewall turned off. Is there anything else I can try? Anything!
View 1 Replies
View Related
Aug 9, 2004
This is the code I'm using on the web page located on the server:
Dim strConn as String
Dim conn as SQLConnection
strConn="server=localhost;Trusted_Connection=Yes;database=CIS"
conn=New SQLConnection(strConn)
conn.Open()
and the error messgae I receive is: Login failed for user 'MSP00427ASPNET'.
msp00427 is the name of the server
= = = = = = = = =
I have an MSAccess application that accesses the same database as follows with no trouble.
glblConnectString = "Driver=SQL Server;Server=msp00427;Database=CIS;Trusted_Connection=Yes"
Set cnn = New ADODB.Connection
cnn.Open glblConnectString
Set cmd = New ADODB.Command
cmd.ActiveConnection = cnn
cmd.CommandText = "Scorecard_Delete_ATLASDataDump"
cmd.CommandType = adCmdStoredProc
cmd.Execute
This is run on my PC and I have sa capabilities on the server.
The .NET framework is installed.
Any ideas why the data access on the web page fails?
View 3 Replies
View Related
Oct 18, 2005
Hi All,I hopen this isnt a stupid question but can I connect asp 1 to sqlserver 2005? i want to update the database used on a ASP.net 1 project, I seem to be able to get it to connect but cant get it to see the tables?Thanks for any helpLee
View 5 Replies
View Related
Dec 31, 2007
unable to connect to sqlserver, server not found error ... i typed the right username and password,,, still i am not able to connect to sqlserver ,,also i tried with new sqlserver registration still i am not able to connect to sqlserver
error :
specified sqlserver not found connection connect()
please help me out
View 2 Replies
View Related
Jul 23, 2007
In SQLserver Admin, ANDONASPNET is setup as a 'Server Admin'
****************************************************************************
Connection string is set in the web.config file.
<configuration>
<connectionStrings>
<add name="SqlServerEx"
connectionString="Data Source=LOCALHOSTSQLEXPRESS;Initial Catalog=DB2;Integrated Security=SSPI;"
providerName="System.Data.SqlClient;"></add>
</connectionStrings>
<appSettings/>
<system.web>
.......................................................................
protected void Button2_Click(object sender, EventArgs e)
{
string connStr = WebConfigurationManager.ConnectionStrings["SqlServerEx"].ConnectionString;
SqlConnection con = new SqlConnection(connStr);
TextBox3.Text = connStr;
try
{
con.Open();
TextBox2.Text = "<b> Server Verison::</b>" + con.ServerVersion;
TextBox2.Text += "<br /><B>Connection Is::</B> " + con.State.ToString();
}
catch (Exception err)
{
TextBox2.Text = "Error reading Database. ";
TextBox2.Text += err.Message;
}
finally
{
con.Close();
TextBox2.Text += "<BR><B>CONNECTION::" + con.State.ToString() + "</B>";
}
}
****************************************************************************
This is the error message I am getting:
"Error reading Database. Instance failure."
View 1 Replies
View Related
May 13, 2008
I have a float variable that holds a decimal number of hours.
So 1.5 equals 1 hour 30 minutes.
I need to change this to the format 1:30
Any idea how to do this?
View 10 Replies
View Related
Feb 28, 2008
Hi all,
I'm not a db guru and probably this is a very simple question for you, but I was wondering if it was possible to connect to a SqlServer using odbc without DSN.
I mean, I'm trying to connect to the db server from a linux (Fedora Core 8) workstation, using odbc drivers, but it looks like I can do that only using a DSN connection and setting properly the odbc.ini file. It doesn't work, if I use a connection like this from a PHP script:
$cn = odbc_connect("Driver={SQL Server};Server=MyServer;Database=MyDatabase",
"MyUser","MyPassword")
Does anyone know how to connect to SqlServer with a DSN-less connection? Could you explain me where is the error?
I'm using SQLServer2005, Fedora Core 8 with the last FreeTDS installed.
Please help!
Thanks million in advance.
View 7 Replies
View Related
Jun 25, 2007
Hi
im trying to connect to sqlserver 2005 using windows authentication and gives me this error "Login failed for user ''. The user is not associated with a trusted SQL Server connection."
any help
thanks in advance.
View 3 Replies
View Related
Dec 28, 2007
Hi.
i got an error when i connect to sqlserver 2005 db with use of Sqlserver ManagementStudio.
A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (.Net SqlClient Data Provider)(Microsoft Sql Error - 64)...
View 4 Replies
View Related
Feb 6, 2007
Currently I cannot connect to a database, I got the system.exception €œPlatformNotSupportedExcoption€?. This database is Polish (COLLATE Polish_CI_AS), when I collate this database to latin general it works fine. I connect by using the system.data.sqlclient.sqlconnection, as far as I can see I cannot set the locale identifier here€¦ What can I do???
Thanks for your help!
regards, Jan
View 3 Replies
View Related
Nov 17, 2006
hi ..
i install sqlserver and make app with vb6 using ADO to connect to the database and successfully
i put that application on another pc on the network
when i open it it says "can't login computernameguest" ??!!
any help
thanks in advance.
View 10 Replies
View Related
Aug 19, 2006
Hi all,
I have Sql Server 2000 installed in my home and also i have a website that works with Sql Server2000 and .Net FrameWork v1.1 ,now i want to know is it possible to connect from my home SqlServer to Host SqlServer( where my Website resides ) through Enterprise manager or Query Analizer to do some data-manipulation And how?
Thanks in advance.Regards.
View 1 Replies
View Related
Dec 23, 2004
I found out that I could use SQLDMO to enumerate objects in a SQL server. However, I can't connect to my server, even though I have both "windows and SQL server" authentication on "(local) Windows NT".
Here is the code (it does not contain the validation in this snippet):
Imports System.Data.SqlClient
Imports SQLDMO
Public Class ADO_2
Inherits System.Web.UI.Page
Protected WithEvents txtQuery As System.Web.UI.WebControls.TextBox
Protected WithEvents txtresults As System.Web.UI.WebControls.TextBox
Protected WithEvents lstDB As System.Web.UI.WebControls.DropDownList
Protected WithEvents lblResult As System.Web.UI.WebControls.Label
Protected WithEvents cmdExecute As System.Web.UI.WebControls.Button
Protected WithEvents cmdNext As System.Web.UI.WebControls.Button
Private m_objConn As New SqlConnection()
Private m_objSQLServer As SQLDMO.SQLServer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
EnumerateDatabases()
'TEMP
lstDB.Items.Add("Northwind")
lstDB.Items.Add("Pubs")
'END TEMP
End Sub
Private Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Unload
m_objConn.Close() 'Just in case.....
End Sub
Private Sub cmdExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExecute.Click
Dim objCommand As SqlCommand
Dim objDataReader As SqlDataReader
Dim intField As Integer
txtresults.Text = String.Empty
m_objConn.ConnectionString = "server=radu;database=" & lstDB.SelectedItem.Text & ";integrated security=SSPI;"
m_objConn.Open()
objCommand = New SqlCommand(txtQuery.Text, m_objConn)
objDataReader = objCommand.ExecuteReader
While objDataReader.Read
txtresults.Text &= vbNewLine
For intField = 0 To objDataReader.FieldCount - 1
txtresults.Text &= objDataReader(intField).ToString.PadRight(15)
Next
End While
objDataReader.Close()
objDataReader = Nothing
objCommand = Nothing
m_objConn.Close()
End Sub
Private Sub EnumerateDatabases()
On Error GoTo EnumerateDatabasesError
Dim objSQLDatabase As SQLDMO.Database
m_objSQLServer = New SQLDMO.SQLServer()
m_objSQLServer.Connect("radu")
'Iterate through all databases on the target server:
For Each objSQLDatabase In m_objSQLServer.Databases
lstDB.Items.Add(objSQLDatabase.Name)
Next objSQLDatabase
EnumerateDatabasesExit:
objSQLDatabase = Nothing
m_objSQLServer.Close()
m_objSQLServer = Nothing
Exit Sub
EnumerateDatabasesError:
lblResult.Text = Err.Number.ToString & ", " & Err.Description
Resume EnumerateDatabasesExit
End Sub
End Class
Why can't I connect with m_objSQLServer.Connect("radu") ? I also tried m_objSQLServer.Connect("radu", "", ""). Otherwise, I can connect just fine with m_objConn.Open() (after I select a db from the dropdownlist, which is for now populated by hand)....
Thanks a lot for your time.
Alex.
View 1 Replies
View Related
Feb 22, 2006
Hi
I've been trying to get DotNetNuke to connect to a SQLServer Express database but no luck. I've had no luck with info from their forums...
The connection string I'm supposed to use is:
<add
name="SiteSqlServer"
connectionString="Data Source=.SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Database.mdf;"
providerName="System.Data.SqlClient" />
I just can't get it to connect to the database. Says something that remote connections are not allowed. I've done the Area thing and allowed all connection including remote connections.
Can't we use the standard string like:
<add
name="SiteSqlServer"
connectionString="Server=(local);Database=DotNetNuke;uid=;pwd=;"
providerName="System.Data.SqlClient" />
...to connect? I'd like to setup a user and give the username and password in the connection string - real easy and non-complicated...
Any ideas or help?
Andre
View 3 Replies
View Related
Sep 10, 2007
Hi,
iam having vs2005 installed on my machine and i also installed sqlserver2005 dev edition on my machine...Unable to connect to Sqlserver 2000 which is installed remotely ....Sqlserver2000 is dev edition.i cudnot find Sqlserver2000 instance when i try to search for Network database engine name .......
I feel to know how to enable remote connection on Sqlserver 2000.So tht i can access this sqlserver2000 from another machine
View 1 Replies
View Related
Sep 28, 2007
i have some oledb code made in c#(vs 2005) it is for local msaccess file. i want to conevert the code for sql server where connection string placed in web.config file seperately. please help me.here is code private void buildGrid()
{
string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
conStr += Server.MapPath("~/common/db/demo.mdb");
System.Data.OleDb.OleDbConnection dbCon = new System.Data.OleDb.OleDbConnection(conStr);
dbCon.Open();
string sql = "SELECT * FROM Posts ORDER BY LastPostDate DESC";
System.Data.OleDb.OleDbDataAdapter dbAdapter = new System.Data.OleDb.OleDbDataAdapter(sql, dbCon);
DataSet ds = new DataSet();
dbAdapter.Fill(ds);
ds.Tables[0].TableName = "Inbox";
Grid1.DataSource = ds;
}
please healp me..
View 3 Replies
View Related
Feb 27, 2006
hi guys,
i am very happy that i found this forum which discuss ASP.net.i am new to ASP.net 2.0 and some need serious help. when i debug my application and try to insert data an error occur saying:"Cannot open database "ecb" requested by the login. The login failed. Login failed for user 'HOME-USERuser'."the code that i have used to submit data is as follow:Imports System.Data.SqlClient... Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click Dim objConn As SqlConnection Dim objCmd As SqlCommand
objconn = New SqlConnection("data source= localhostsqlexpress; initial catalog =ecb; persist security info =true; trusted_connection=true")
objCmd = New SqlCommand("INSERT INTO staff (firstname, surname) VALUES (@firstname, @surname,)", objConn)objCmd.Parameters.Add("@FirstName", Data.SqlDbType.VarChar).Value = txtFirstName.TextobjCmd.Parameters.Add("@Surname", Data.SqlDbType.VarChar).Value = txtSurname.TextobjConn.Open()objCmd.ExecuteNonQuery()objConn.Close()
i also used this data connection but didn't help: objconn = New SqlConnection("Server=localhost; Database=ecb;user ID=' ';Password=' ' ") when i use this data
connection i get this message: Login failed for user ''. The user is not associated with a trusted SQL Server connection.
as far as i can remember i have used windows authentication when creating my database in sql server 200 express edition.
the funny thing is that when i use datagrid wizard or dataform the connection is fine ( i mean is automatically done for me but i don't know when i like to do it manually does not work).can anyone help? thank you in advanced
View 5 Replies
View Related
Oct 31, 2007
How to Connect sqlServer 2000 in Pocket PC 2003 Application.
In Packet PC 2003 Application I have to connect to sql server 2000 on
my machine. The application gives error if connected using sqlConnection. Is SQL server CE necessary to connect to sql server 2000 in .Net Compact Framework?
View 1 Replies
View Related
Sep 7, 2006
Hi All,
I want to connect to SQLExpress database on the network. I can do so using code but I want to use the Data Source Configuration Wizard. It seems this only works for local instances of SQL server. Is this true?
I can connect just fine to the database on the network using Microsoft SQL Server Management Studio Express...for what this is worth.
I have tried to map a drive to the SQL server machine and pick the mdf file but I get the error msg of network path is not supported for database files....I have turned on allow remote connections, allow tcp/ip, named pipes, added sqlserv.exe and sqlbrowser.exe to my firewall exceptions ect..
I want to be able to use Table Adapters, SqlDataAdapters ect. After reading numerous forum questions/ kb articles this seems to be a common problem. I am on the verge of just saying forget it and use MS Access instead.
Thanks in advance!
View 4 Replies
View Related
Jun 9, 2003
Should these two stats added together give me the time (ms) since SQL Server has been restarted? Maybe I don't understand but @@cpu_busy is the amount of time sql server has accessed the cpu and @@idle is the amount of time sql server has no cpu activity. When I add these two figures together, I don't get the total amount of time (ms) SQL Server has been running. What am I not doing? Any help is appreciated.
Thanks
View 6 Replies
View Related
Feb 17, 2004
Hi
I've bin using MySQL and now trying to convert it on to SQL 2000 and i've got a couple of questions
1. Ive got a SQL Script of a database generated by MySQL, can i run this script stright into SQL 2000 and if so how do i go about it ????
2. In my MySQL i have a Gender field which data type is Enum ('M','F'). How do i recreate this type of field in SQL 2000.
Thanks
View 3 Replies
View Related
Nov 23, 2006
Hi everyone,
Running Windows 2003 x64 and Sql25k 64-bit edition
We just have a couple of questions related with our system:
-What is Sql Server VSS Writer service for?
-What sort of implications must we assume when Integration Services service is running as NT AUTHORITYNetworkService
Any link or advice would be welcomed.
Thanks for your time,
View 3 Replies
View Related
Oct 9, 2006
I need to:
Copy an existing production database to a new database on the same server; this will be used for development.
Copy an existing table for backup purposes in preparation for deleting a couple fields from the table (precautionary process really).
I've been out of the database swing if you will for a while, just now getting the opportunity to get my feet wet so to speak. I can use either Enterprise Manager or connec to the database via ODBC and make the copies/deletes there, but I'm looking to do this via EM or SQL command.
Any help or direction would be greatly appreciated!
Thanks!
Bobby
View 3 Replies
View Related
May 11, 2007
I have made a report in SRS and am not sure of how to do some of the functions I need.
In SQL I can use UPPER to convert to upper case, SRS doesn't seem to like this. The report runs but the line that is to be upper case is missing. If I remove the UPPER word from my query it works fine just displaying in lower case. Am I doing something wrong?
In Excel 2007 (I am converting my report from Excel to SRS) there is a function called NETWORKDAYS (Returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays. Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days worked during a specific term.) Is there something similar I can use in SRS?
Thanks.
View 3 Replies
View Related
Jan 29, 2008
Hello everybody,I have a ASP.NET (3.5) Web site which uses an data connection to my Sql Server 2005 Express. When I browse in my data-driven pages of my website, I am satisfied with the performance. But when I try my website after a long break, e.g. in the morning, the data-driven pages take a long time to come up, about 10 seconds. After this gap, when surfing on the other pages, there is no problem. It is only the first page. So it seems that my SQL Server goes "to sleep" after a certain time of idle.First I read a post about this problem which came up with the user instances of Sql Server. So I got rid of my user instance and set up my database "normally". But still I have that performance gap.I am using Linq To SQL and a couple of ListViews. I am totally confused how to manage this problem.Any suggestions?Thanks in advance,Hannes
View 1 Replies
View Related
Jun 18, 2001
Hi all,
We got this message on our production server event viewer for source MSDTC.
"String message: Session idle timeout over,tearing down the session"..
Even though it is marked as informational, just wanted to know what it is?..
thanks guys,
Marx
View 1 Replies
View Related
Sep 20, 2007
folks
We have a situation where people just login run complex queries and then just don't shut off their query analyzer of apps.
Some of these chew up a lot of CPU cycles and unless we kill the query the CPU cycles are not released.
I see some of them are idle for over 1-2 hours or more, their last_batch would be at least 2 hours old.
The question is, "Is there a setting in the sql server whereby we can automatically disconnect idle threads?"
Regards
Paresh Motiwala
Boston, USA
View 4 Replies
View Related
Mar 21, 2006
Is it possible to stop the server from going to sleep when it is idle to improve responsiveness to new connections?
View 21 Replies
View Related