From shamil at smsconsulting.spb.ru Sun Jun 5 15:12:43 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Jun 2011 00:12:43 +0400 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: <91E8E248DC5845CBA678F51B568217E5@nant> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From Gustav at cactus.dk Mon Jun 6 04:41:52 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 11:41:52 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil So what you try to tell ... is that a colon on its own now is reserved for the use as the separator between the value and the format string? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From stuart at lexacorp.com.pg Mon Jun 6 04:57:15 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 06 Jun 2011 19:57:15 +1000 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 In-Reply-To: References: Message-ID: <4DECA47B.29763.1FEC6F0@stuart.lexacorp.com.pg> Not just the colon, any separator: The custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, "dd\.hh\:mm" defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours and minutes. -- Stuart On 6 Jun 2011 at 11:41, Gustav Brock wrote: > Hi Shamil > > So what you try to tell ... is that a colon on its own now is reserved > for the use as the separator between the value and the format string? > > /gustav > > > >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> > Hi All -- > > FYI: I have got used to format TimeStamp values this simple way (for > TimeStamp values less than a day): > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh:mm:ss}", ts); > System.Console.WriteLine(s); > > and it worked well for VS2008/.NET 3.5 but when my project was > converted to VS2010SP1/.NET 4.0 I have got runtime error... > > Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh\\:mm\\:ss}", ts); > System.Console.WriteLine(s); > > Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx > > Thank you. > > -- > Shamil > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Mon Jun 6 05:07:46 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 12:07:46 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From Gustav at cactus.dk Mon Jun 6 06:07:05 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 13:07:05 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Stuart Well, yes for the format string, but "any" separator is not (can not) be used to separate the value and the format string; it has to be a colon: string s = string.Format("{0:hh\\:mm\\:ss}", ts); /gustav >>> "Stuart McLachlan" 06-06-2011 11:57 >>> Not just the colon, any separator: The custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, "dd\.hh\:mm" defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours and minutes. -- Stuart On 6 Jun 2011 at 11:41, Gustav Brock wrote: > Hi Shamil > > So what you try to tell ... is that a colon on its own now is reserved > for the use as the separator between the value and the format string? > > /gustav > > > >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> > Hi All -- > > FYI: I have got used to format TimeStamp values this simple way (for > TimeStamp values less than a day): > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh:mm:ss}", ts); > System.Console.WriteLine(s); > > and it worked well for VS2008/.NET 3.5 but when my project was > converted to VS2010SP1/.NET 4.0 I have got runtime error... > > Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh\\:mm\\:ss}", ts); > System.Console.WriteLine(s); > > Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx > > Thank you. > > -- > Shamil From fhtapia at gmail.com Wed Jun 8 10:47:35 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 8 Jun 2011 08:47:35 -0700 Subject: [dba-VB] closing your connections Message-ID: so I have a vb.net app (visual studio 2008) and I am making some sproc calls like so: conn = New SqlConnection(My.MySettings.Default.dbConn) cmd = New SqlCommand("dbo.stp_PCO", conn) cmd.CommandType = CommandType.StoredProcedure conn.Open() da.SelectCommand = cmd da.Fill(dtCTable) I've also tried closing my connections after usage by using the following closing statments dtCtable.Dispose() dtClockTable = nothing cmd.Dispose() cmd = nothing da.Dispose() da = nothing conn.close() conn.Dispose() conn = nothing but when I check my sql server I still see sleeping entires in the activity monitor suggesting that a connection is still active. How do I sever the connection completely? I know a connection is alive and well because I noticed that if I completely close the application the connection goes from sleeping to gone. I want my connections to close once the data has been retrieved to allow the server to reuse that memory if needed. in vb 6 it used to be so simple with just ado :( your help is of course appreciated! -Francisco From davidmcafee at gmail.com Wed Jun 8 12:22:21 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 8 Jun 2011 10:22:21 -0700 Subject: [dba-VB] closing your connections In-Reply-To: References: Message-ID: This is what I do with SQLCE when I need to modify the SDF, which shouldn't differ too much from SQL Server: Dim strCEconn As String = "Data Source = " & strPath & strFileName Dim CEconn As SqlServerCe.SqlCeConnection = New SqlServerCe.SqlCeConnection(strCEconn) CEconn.Open() Dim CEcmd As SqlServerCe.SqlCeCommand = CEconn.CreateCommand CEcmd.CommandText = "CREATE TABLE InvoiceOrderJunct([InvNo] [nvarchar](8) NULL, [OrderID] [int], [AMNo] [nvarchar](10) NULL)" CEcmd.ExecuteNonQuery() CEcmd.Dispose() CEconn.Close() CEconn.Dispose() I had to do this in one of my webservice functions, when we had weird issues: _ Public Function InsertInvHdr(ByVal strInput As String, ByVal dsIn As DataSet) As String Dim errNum As Integer Dim errMsg As String Dim myConnection As SqlConnection Dim myCommand As SqlCommand Dim row As DataRow Call fUnSecureString(strInput) Try 'Following parameters are determined from strInput hash saved as global variables myConnection = New SqlConnection("server=" & ServerName & ";uid=" & strUid & ";pwd=" & strPw& ";database=" & strDBname) myConnection.Open() myCommand = New SqlCommand myCommand.Connection = myConnection For Each row In dsIn.Tables(0).Rows myCommand.CommandText = "EXEC stpInsertIntoInvHdr '" & row("ICNo").ToString() & "', '" & row("StoreNo").ToString() & "', '" & row("CustNo").ToString() myCommand.ExecuteNonQuery() Next Return "InvHdr data inserted" 'myConnection.Close() '****************************************************************** ' Added the 2 IF statements below on 8/4/2010 to see if it clears out sleeping processes If (Not (myCommand) Is Nothing) Then myCommand.Dispose() myCommand = Nothing End If If (Not (myConnection) Is Nothing) Then myConnection.Close() End If '******************************************************** Catch ex As Exception errNum = Err.Number errMsg = ex.Message Return "SQL/WS Error: WS.InsertInvHdr - " & errNum & ":" & errMsg 'Finally ' myConnection.Close() End Try End Function On Wed, Jun 8, 2011 at 8:47 AM, Francisco Tapia wrote: > so I have a vb.net app (visual studio 2008) and I am making some sproc > calls > like so: > > > conn = New SqlConnection(My.MySettings.Default.dbConn) > cmd = New SqlCommand("dbo.stp_PCO", conn) > cmd.CommandType = CommandType.StoredProcedure > conn.Open() > da.SelectCommand = cmd > da.Fill(dtCTable) > > I've also tried closing my connections after usage by using the following > closing statments > > dtCtable.Dispose() > dtClockTable = nothing > cmd.Dispose() > cmd = nothing > da.Dispose() > da = nothing > conn.close() > conn.Dispose() > conn = nothing > > but when I check my sql server I still see sleeping entires in the activity > monitor suggesting that a connection is still active. How do I sever the > connection completely? I know a connection is alive and well because I > noticed that if I completely close the application the connection goes from > sleeping to gone. I want my connections to close once the data has been > retrieved to allow the server to reuse that memory if needed. > > in vb 6 it used to be so simple with just ado :( > > your help is of course appreciated! > > > -Francisco > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Jun 11 09:36:53 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 11 Jun 2011 18:36:53 +0400 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 In-Reply-To: References: Message-ID: Hi Gustav -- That was "miPtySing". I meant .NET Framework's built-in System.TimeSpan struct not TimeStamp (which doesn't exist). I typed my code snippet from memory and my "brainputer"'s memory obviously "got a Glueck" after a heavy duty working day of a large batch of VS2008 projects conversion to VS2010. Correct sample code snippet should have been something like the following: // Define TimeSpan value equal to // 10 hours 11 minutes and 12 seconds TimeSpan ts = new TimeSpan(10, 11, 12); // correct TimeSpan value formatting string s = string.Format("Correct = {0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); // incorrect TimeSpan value formatting try { s = string.Format("Incorrect = {0:hh:mm:ss}", ts); System.Console.WriteLine(s); } catch (Exception ex) { System.Console.WriteLine("Error: {0}", ex.Message); } Thank you. -- Shamil P.S. Sorry for delay with my reply - I've got a short vacation immediately after I have posted to Access-D my original posting... -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ???? 2011 ?. 14:08 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From gustav at cactus.dk Sat Jun 11 17:30:44 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 12 Jun 2011 00:30:44 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil Ha ha, "got a Glueck", that explains! /gustav >>> shamil at smsconsulting.spb.ru 11-06-2011 16:36 >>> Hi Gustav -- That was "miPtySing". I meant .NET Framework's built-in System.TimeSpan struct not TimeStamp (which doesn't exist). I typed my code snippet from memory and my "brainputer"'s memory obviously "got a Glueck" after a heavy duty working day of a large batch of VS2008 projects conversion to VS2010. Correct sample code snippet should have been something like the following: // Define TimeSpan value equal to // 10 hours 11 minutes and 12 seconds TimeSpan ts = new TimeSpan(10, 11, 12); // correct TimeSpan value formatting string s = string.Format("Correct = {0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); // incorrect TimeSpan value formatting try { s = string.Format("Incorrect = {0:hh:mm:ss}", ts); System.Console.WriteLine(s); } catch (Exception ex) { System.Console.WriteLine("Error: {0}", ex.Message); } Thank you. -- Shamil P.S. Sorry for delay with my reply - I've got a short vacation immediately after I have posted to Access-D my original posting... -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ???? 2011 ?. 14:08 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From fhtapia at gmail.com Mon Jun 13 14:37:38 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 13 Jun 2011 12:37:38 -0700 Subject: [dba-VB] closing your connections In-Reply-To: References: Message-ID: I'm not sure, I am closing and disposing my objects as I posted in my first post... but if I monitor the sql server I notice that the connection is still active.(in awaiting sleep status but connected) :-/ -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Wed, Jun 8, 2011 at 10:22 AM, David McAfee wrote: > This is what I do with SQLCE when I need to modify the SDF, which shouldn't > differ too much from SQL Server: > > Dim strCEconn As String = "Data Source = " & strPath & strFileName > Dim CEconn As SqlServerCe.SqlCeConnection = New > SqlServerCe.SqlCeConnection(strCEconn) > CEconn.Open() > Dim CEcmd As SqlServerCe.SqlCeCommand = CEconn.CreateCommand > > CEcmd.CommandText = "CREATE TABLE InvoiceOrderJunct([InvNo] > [nvarchar](8) NULL, [OrderID] [int], [AMNo] [nvarchar](10) NULL)" > CEcmd.ExecuteNonQuery() > > CEcmd.Dispose() > CEconn.Close() > CEconn.Dispose() > > > I had to do this in one of my webservice functions, when we had weird > issues: > > > _ > Public Function InsertInvHdr(ByVal strInput As String, ByVal dsIn As > DataSet) As String > > Dim errNum As Integer > Dim errMsg As String > Dim myConnection As SqlConnection > Dim myCommand As SqlCommand > Dim row As DataRow > > Call fUnSecureString(strInput) > > Try > 'Following parameters are determined from strInput hash saved as > global variables > myConnection = New SqlConnection("server=" & ServerName & > ";uid=" & strUid & ";pwd=" & strPw& ";database=" & strDBname) > myConnection.Open() > myCommand = New SqlCommand > myCommand.Connection = myConnection > > For Each row In dsIn.Tables(0).Rows > myCommand.CommandText = "EXEC stpInsertIntoInvHdr '" & > row("ICNo").ToString() & "', '" & row("StoreNo").ToString() & "', '" & > row("CustNo").ToString() > myCommand.ExecuteNonQuery() > Next > > Return "InvHdr data inserted" > 'myConnection.Close() > > '****************************************************************** > ' Added the 2 IF statements below on 8/4/2010 to see if it > clears out sleeping processes > If (Not (myCommand) Is Nothing) Then > myCommand.Dispose() > myCommand = Nothing > End If > If (Not (myConnection) Is Nothing) Then > myConnection.Close() > End If > '******************************************************** > Catch ex As Exception > errNum = Err.Number > errMsg = ex.Message > Return "SQL/WS Error: WS.InsertInvHdr - " & errNum & ":" & > errMsg > 'Finally > ' myConnection.Close() > End Try > End Function > > > > On Wed, Jun 8, 2011 at 8:47 AM, Francisco Tapia wrote: > > > so I have a vb.net app (visual studio 2008) and I am making some sproc > > calls > > like so: > > > > > > conn = New SqlConnection(My.MySettings.Default.dbConn) > > cmd = New SqlCommand("dbo.stp_PCO", conn) > > cmd.CommandType = CommandType.StoredProcedure > > conn.Open() > > da.SelectCommand = cmd > > da.Fill(dtCTable) > > > > I've also tried closing my connections after usage by using the following > > closing statments > > > > dtCtable.Dispose() > > dtClockTable = nothing > > cmd.Dispose() > > cmd = nothing > > da.Dispose() > > da = nothing > > conn.close() > > conn.Dispose() > > conn = nothing > > > > but when I check my sql server I still see sleeping entires in the > activity > > monitor suggesting that a connection is still active. How do I sever the > > connection completely? I know a connection is alive and well because I > > noticed that if I completely close the application the connection goes > from > > sleeping to gone. I want my connections to close once the data has been > > retrieved to allow the server to reuse that memory if needed. > > > > in vb 6 it used to be so simple with just ado :( > > > > your help is of course appreciated! > > > > > > -Francisco > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jun 14 15:06:10 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 14 Jun 2011 16:06:10 -0400 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 Message-ID: <4DF7BF32.1090405@colbyconsulting.com> It has finally arrived! -- John W. Colby www.ColbyConsulting.com http://techreport.com/articles.x/16255 From fhtapia at gmail.com Thu Jun 16 10:58:04 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 16 Jun 2011 08:58:04 -0700 Subject: [dba-VB] A windows Service or Not a service? Message-ID: I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stationsand Desktopsin the Platform SDK documentation. -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) From jwcolby at colbyconsulting.com Thu Jun 16 11:32:25 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Jun 2011 12:32:25 -0400 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: <4DFA3019.7020109@colbyconsulting.com> I too need to know this. A service cannot directly support a user interface because if there is no one logged in there is no place to put the user interface (no screen to draw it). My guess is that the user interface somehow calls functions to get information, or perhaps hooks a data "service" channel to read / write to the service application. John W. Colby www.ColbyConsulting.com On 6/16/2011 11:58 AM, Francisco Tapia wrote: > I wrote a simple application that has a form and two buttons (along with a > timer). My initial idea was that I would write this to be a windows service > so it would auto-start whenever a specific server would reboot etc. The > purpose is that I need to get new records created by a "Vendor" application > and have them sent to a Second "Vendor" system. I call a custom view that I > wrote that collects that last set of changes, then record by record calls a > webservice on our SAP system and pushes in the new changes. My sql server > version is Sql Server 2000 so it's not as easy as just writing a soap object > to make the webservice call, I think it was much easier to just write the > app in c# and make the call that way, which works. NOW for the tricky > part. I wanted to write up the app to create a windows service installer so > that my admins could log into the windows server and either start or stop > the application, I also wanted to provide a gui view to the windows service > so that they could choose a different timer so it could run every 1 minute > (every 2 minutes, etc..) what ever they would choose. > > after reading MS's description on windows service classes, I noticed that > supposedly the .Net Studio does not support this, but I've seen other apps > that DO provide a gui view to the windows service that they introduce. so > my question to the group is, have you done this before? and if so how did > you go about it? > > -- > http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx > > The Windows service classes supported by the .NET Framework do not support > interaction with interactive stations, that is, the logged-on user. The .NET > Framework also does not include classes that represent stations and > desktops. If your Windows service must interact with other stations, you > will need to access the unmanaged Windows API. For more information, see Window > Stationsand > Desktopsin > the Platform SDK documentation. > > > -Francisco > http://bit.ly/sqlthis | Tsql and More... > http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From fhtapia at gmail.com Thu Jun 16 11:35:09 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 16 Jun 2011 09:35:09 -0700 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: <4DFA3019.7020109@colbyconsulting.com> References: <4DFA3019.7020109@colbyconsulting.com> Message-ID: I'm wondering about that too, does that mean that I need to package "2" applications? one service with a port that will talk to the gui so that a user can modify a specific setting (namely, how often it checks for new records). -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Thu, Jun 16, 2011 at 9:32 AM, jwcolby wrote: > I too need to know this. A service cannot directly support a user > interface because if there is no one logged in there is no place to put the > user interface (no screen to draw it). My guess is that the user interface > somehow calls functions to get information, or perhaps hooks a data > "service" channel to read / write to the service application. > > John W. Colby > www.ColbyConsulting.com > > > On 6/16/2011 11:58 AM, Francisco Tapia wrote: > >> I wrote a simple application that has a form and two buttons (along with a >> timer). My initial idea was that I would write this to be a windows >> service >> so it would auto-start whenever a specific server would reboot etc. The >> purpose is that I need to get new records created by a "Vendor" >> application >> and have them sent to a Second "Vendor" system. I call a custom view that >> I >> wrote that collects that last set of changes, then record by record calls >> a >> webservice on our SAP system and pushes in the new changes. My sql server >> version is Sql Server 2000 so it's not as easy as just writing a soap >> object >> to make the webservice call, I think it was much easier to just write the >> app in c# and make the call that way, which works. NOW for the tricky >> part. I wanted to write up the app to create a windows service installer >> so >> that my admins could log into the windows server and either start or stop >> the application, I also wanted to provide a gui view to the windows >> service >> so that they could choose a different timer so it could run every 1 minute >> (every 2 minutes, etc..) what ever they would choose. >> >> after reading MS's description on windows service classes, I noticed that >> supposedly the .Net Studio does not support this, but I've seen other apps >> that DO provide a gui view to the windows service that they introduce. so >> my question to the group is, have you done this before? and if so how did >> you go about it? >> >> -- >> http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx >> >> The Windows service classes supported by the .NET Framework do not support >> interaction with interactive stations, that is, the logged-on user. The >> .NET >> Framework also does not include classes that represent stations and >> desktops. If your Windows service must interact with other stations, you >> will need to access the unmanaged Windows API. For more information, see >> Window >> Stations< >> http://msdn.microsoft.com/en-us/library/ms687096%28v=VS.90%29.aspx>and >> Desktops< >> http://msdn.microsoft.com/en-us/library/ms682573%28v=VS.90%29.aspx>in >> >> the Platform SDK documentation. >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> >> _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From dw-murphy at cox.net Thu Jun 16 12:38:47 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 16 Jun 2011 10:38:47 -0700 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: <4DFA3019.7020109@colbyconsulting.com> Message-ID: <009601cc2c4c$3f663020$be329060$@cox.net> How about having a little config file that goes along with the service that you could edit in notepad or xml note pad since .NET loves xml files. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, June 16, 2011 9:35 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] A windows Service or Not a service? I'm wondering about that too, does that mean that I need to package "2" applications? one service with a port that will talk to the gui so that a user can modify a specific setting (namely, how often it checks for new records). -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Thu, Jun 16, 2011 at 9:32 AM, jwcolby wrote: > I too need to know this. A service cannot directly support a user > interface because if there is no one logged in there is no place to > put the user interface (no screen to draw it). My guess is that the > user interface somehow calls functions to get information, or perhaps > hooks a data "service" channel to read / write to the service application. > > John W. Colby > www.ColbyConsulting.com > > > On 6/16/2011 11:58 AM, Francisco Tapia wrote: > >> I wrote a simple application that has a form and two buttons (along >> with a timer). My initial idea was that I would write this to be a >> windows service so it would auto-start whenever a specific server >> would reboot etc. The purpose is that I need to get new records >> created by a "Vendor" >> application >> and have them sent to a Second "Vendor" system. I call a custom view >> that I wrote that collects that last set of changes, then record by >> record calls a webservice on our SAP system and pushes in the new >> changes. My sql server version is Sql Server 2000 so it's not as >> easy as just writing a soap object to make the webservice call, I >> think it was much easier to just write the app in c# and make the >> call that way, which works. NOW for the tricky part. I wanted to >> write up the app to create a windows service installer so that my >> admins could log into the windows server and either start or stop the >> application, I also wanted to provide a gui view to the windows >> service so that they could choose a different timer so it could run >> every 1 minute (every 2 minutes, etc..) what ever they would choose. >> >> after reading MS's description on windows service classes, I noticed >> that supposedly the .Net Studio does not support this, but I've seen >> other apps that DO provide a gui view to the windows service that >> they introduce. so my question to the group is, have you done this >> before? and if so how did you go about it? >> >> -- >> http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx >> >> The Windows service classes supported by the .NET Framework do not >> support interaction with interactive stations, that is, the logged-on >> user. The .NET Framework also does not include classes that represent >> stations and desktops. If your Windows service must interact with >> other stations, you will need to access the unmanaged Windows API. >> For more information, see Window Stations< >> http://msdn.microsoft.com/en-us/library/ms687096%28v=VS.90%29.aspx>an >> d >> Desktops< >> http://msdn.microsoft.com/en-us/library/ms682573%28v=VS.90%29.aspx>in >> >> the Platform SDK documentation. >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> >> _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 16 12:50:06 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 16 Jun 2011 21:50:06 +0400 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: <0466803437EC465DB77794C395A63253@nant> Hi Francisco, I have written a few real life WinServices working 24x7x365 for a few years. When a Windows Service Project is created its base class has code snippet as the following: public partial class MyService : ServiceBase { ... protected override void OnCustomCommand(int command) { switch(command) { case 503: CustomCommand503(); return; ... } } } It allows to define as many custom commands as you wanted to have. You comunicate with a Windows Service using that custom commands' IDs - here is a code snippet showing how to find your installed and runing Windows Service and to pass to it your custom command ID: public static void RunCustomServiceCommand(string serviceName, int commandId) { foreach (System.ServiceProcess.ServiceController service in System.ServiceProcess.ServiceController.GetServices()) { // juts a test output - commented it when not needed System.Console.WriteLine("[{0}].[{1}].[{2}]", service.MachineName, service.ServiceName, service.DisplayName); if (string.Compare(service.ServiceName, serviceName, true) == 0) { service.ExecuteCommand(commandId); } } } When I need to pass to a Windows Service more parameters than command id then I use inderect/intermediate media: files, database tables, ... Another issue is to smoothly install, run, stop, uninstall a Windows service - there should be more info on Internet and MSDN about that issues... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: 16 ???? 2011 ?. 19:58 To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] A windows Service or Not a service? I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stations and Desktops in the Platform SDK documentation. -Francisco From DWUTKA at Marlow.com Thu Jun 16 17:08:46 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 16 Jun 2011 17:08:46 -0500 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: An NT Service (as you are calling it a Windows Service) is an executable that is running on your machine and it has several different 'properties'. First, the type of startup... either manual, disabled or automatic. Automatic starts when you computer starts. Disabled means the service won't start. Secondly, there is an 'interactive' option, that determines if a service can run with an interface. For this to work, it has to have user credentials. Services with a user interface can run into all sorts of issues. I personally haven't built a service in .net yet, but have had lots of experience with them in VB 6. What you really want to do is build a service that has no interface, and then build a program that 'controls' that program. This can be done in many ways, either you can have the control change values in a database or file, that the service utilizes, or you can create various 'talking' methods, like named pipes, tcp/ip comms, etc, that allows the controlling program to directly talk to the service. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, June 16, 2011 10:58 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] A windows Service or Not a service? I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stationsand Desktopsin the Platform SDK documentation. -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From john at winhaven.net Mon Jun 20 14:02:12 2011 From: john at winhaven.net (John Bartow) Date: Mon, 20 Jun 2011 14:02:12 -0500 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <4DF7BF32.1090405@colbyconsulting.com> References: <4DF7BF32.1090405@colbyconsulting.com> Message-ID: <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> JC, Have you put in your order yet? http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% 20Solid%20State%20Drive&idno_no=270 John B -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, June 14, 2011 3:06 PM To: Access Developers discussion and problem solving; VBA; Sqlserver-Dba Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 It has finally arrived! http://techreport.com/articles.x/16255 From jwcolby at colbyconsulting.com Mon Jun 20 14:06:57 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Jun 2011 15:06:57 -0400 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> References: <4DF7BF32.1090405@colbyconsulting.com> <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> Message-ID: <4DFF9A51.60503@colbyconsulting.com> Nope, too much money for me. If they would do it for $199 I would have it on order already. John W. Colby www.ColbyConsulting.com On 6/20/2011 3:02 PM, John Bartow wrote: > http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% > 20Solid%20State%20Drive&idno_no=270 > From john at winhaven.net Mon Jun 20 14:17:41 2011 From: john at winhaven.net (John Bartow) Date: Mon, 20 Jun 2011 14:17:41 -0500 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <4DFF9A51.60503@colbyconsulting.com> References: <4DF7BF32.1090405@colbyconsulting.com> <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> <4DFF9A51.60503@colbyconsulting.com> Message-ID: <002701cc2f7e$b9cb6080$2d622180$@winhaven.net> LOL! Give it a couple of months. It'll be on clearance at Fry's. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, June 20, 2011 2:07 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 Nope, too much money for me. If they would do it for $199 I would have it on order already. John W. Colby www.ColbyConsulting.com On 6/20/2011 3:02 PM, John Bartow wrote: > http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% > 20Solid%20State%20Drive&idno_no=270 > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sun Jun 5 15:12:43 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Jun 2011 00:12:43 +0400 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: <91E8E248DC5845CBA678F51B568217E5@nant> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From Gustav at cactus.dk Mon Jun 6 04:41:52 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 11:41:52 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil So what you try to tell ... is that a colon on its own now is reserved for the use as the separator between the value and the format string? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From stuart at lexacorp.com.pg Mon Jun 6 04:57:15 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 06 Jun 2011 19:57:15 +1000 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 In-Reply-To: References: Message-ID: <4DECA47B.29763.1FEC6F0@stuart.lexacorp.com.pg> Not just the colon, any separator: The custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, "dd\.hh\:mm" defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours and minutes. -- Stuart On 6 Jun 2011 at 11:41, Gustav Brock wrote: > Hi Shamil > > So what you try to tell ... is that a colon on its own now is reserved > for the use as the separator between the value and the format string? > > /gustav > > > >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> > Hi All -- > > FYI: I have got used to format TimeStamp values this simple way (for > TimeStamp values less than a day): > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh:mm:ss}", ts); > System.Console.WriteLine(s); > > and it worked well for VS2008/.NET 3.5 but when my project was > converted to VS2010SP1/.NET 4.0 I have got runtime error... > > Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh\\:mm\\:ss}", ts); > System.Console.WriteLine(s); > > Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx > > Thank you. > > -- > Shamil > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Mon Jun 6 05:07:46 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 12:07:46 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From Gustav at cactus.dk Mon Jun 6 06:07:05 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 13:07:05 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Stuart Well, yes for the format string, but "any" separator is not (can not) be used to separate the value and the format string; it has to be a colon: string s = string.Format("{0:hh\\:mm\\:ss}", ts); /gustav >>> "Stuart McLachlan" 06-06-2011 11:57 >>> Not just the colon, any separator: The custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, "dd\.hh\:mm" defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours and minutes. -- Stuart On 6 Jun 2011 at 11:41, Gustav Brock wrote: > Hi Shamil > > So what you try to tell ... is that a colon on its own now is reserved > for the use as the separator between the value and the format string? > > /gustav > > > >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> > Hi All -- > > FYI: I have got used to format TimeStamp values this simple way (for > TimeStamp values less than a day): > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh:mm:ss}", ts); > System.Console.WriteLine(s); > > and it worked well for VS2008/.NET 3.5 but when my project was > converted to VS2010SP1/.NET 4.0 I have got runtime error... > > Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh\\:mm\\:ss}", ts); > System.Console.WriteLine(s); > > Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx > > Thank you. > > -- > Shamil From fhtapia at gmail.com Wed Jun 8 10:47:35 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 8 Jun 2011 08:47:35 -0700 Subject: [dba-VB] closing your connections Message-ID: so I have a vb.net app (visual studio 2008) and I am making some sproc calls like so: conn = New SqlConnection(My.MySettings.Default.dbConn) cmd = New SqlCommand("dbo.stp_PCO", conn) cmd.CommandType = CommandType.StoredProcedure conn.Open() da.SelectCommand = cmd da.Fill(dtCTable) I've also tried closing my connections after usage by using the following closing statments dtCtable.Dispose() dtClockTable = nothing cmd.Dispose() cmd = nothing da.Dispose() da = nothing conn.close() conn.Dispose() conn = nothing but when I check my sql server I still see sleeping entires in the activity monitor suggesting that a connection is still active. How do I sever the connection completely? I know a connection is alive and well because I noticed that if I completely close the application the connection goes from sleeping to gone. I want my connections to close once the data has been retrieved to allow the server to reuse that memory if needed. in vb 6 it used to be so simple with just ado :( your help is of course appreciated! -Francisco From davidmcafee at gmail.com Wed Jun 8 12:22:21 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 8 Jun 2011 10:22:21 -0700 Subject: [dba-VB] closing your connections In-Reply-To: References: Message-ID: This is what I do with SQLCE when I need to modify the SDF, which shouldn't differ too much from SQL Server: Dim strCEconn As String = "Data Source = " & strPath & strFileName Dim CEconn As SqlServerCe.SqlCeConnection = New SqlServerCe.SqlCeConnection(strCEconn) CEconn.Open() Dim CEcmd As SqlServerCe.SqlCeCommand = CEconn.CreateCommand CEcmd.CommandText = "CREATE TABLE InvoiceOrderJunct([InvNo] [nvarchar](8) NULL, [OrderID] [int], [AMNo] [nvarchar](10) NULL)" CEcmd.ExecuteNonQuery() CEcmd.Dispose() CEconn.Close() CEconn.Dispose() I had to do this in one of my webservice functions, when we had weird issues: _ Public Function InsertInvHdr(ByVal strInput As String, ByVal dsIn As DataSet) As String Dim errNum As Integer Dim errMsg As String Dim myConnection As SqlConnection Dim myCommand As SqlCommand Dim row As DataRow Call fUnSecureString(strInput) Try 'Following parameters are determined from strInput hash saved as global variables myConnection = New SqlConnection("server=" & ServerName & ";uid=" & strUid & ";pwd=" & strPw& ";database=" & strDBname) myConnection.Open() myCommand = New SqlCommand myCommand.Connection = myConnection For Each row In dsIn.Tables(0).Rows myCommand.CommandText = "EXEC stpInsertIntoInvHdr '" & row("ICNo").ToString() & "', '" & row("StoreNo").ToString() & "', '" & row("CustNo").ToString() myCommand.ExecuteNonQuery() Next Return "InvHdr data inserted" 'myConnection.Close() '****************************************************************** ' Added the 2 IF statements below on 8/4/2010 to see if it clears out sleeping processes If (Not (myCommand) Is Nothing) Then myCommand.Dispose() myCommand = Nothing End If If (Not (myConnection) Is Nothing) Then myConnection.Close() End If '******************************************************** Catch ex As Exception errNum = Err.Number errMsg = ex.Message Return "SQL/WS Error: WS.InsertInvHdr - " & errNum & ":" & errMsg 'Finally ' myConnection.Close() End Try End Function On Wed, Jun 8, 2011 at 8:47 AM, Francisco Tapia wrote: > so I have a vb.net app (visual studio 2008) and I am making some sproc > calls > like so: > > > conn = New SqlConnection(My.MySettings.Default.dbConn) > cmd = New SqlCommand("dbo.stp_PCO", conn) > cmd.CommandType = CommandType.StoredProcedure > conn.Open() > da.SelectCommand = cmd > da.Fill(dtCTable) > > I've also tried closing my connections after usage by using the following > closing statments > > dtCtable.Dispose() > dtClockTable = nothing > cmd.Dispose() > cmd = nothing > da.Dispose() > da = nothing > conn.close() > conn.Dispose() > conn = nothing > > but when I check my sql server I still see sleeping entires in the activity > monitor suggesting that a connection is still active. How do I sever the > connection completely? I know a connection is alive and well because I > noticed that if I completely close the application the connection goes from > sleeping to gone. I want my connections to close once the data has been > retrieved to allow the server to reuse that memory if needed. > > in vb 6 it used to be so simple with just ado :( > > your help is of course appreciated! > > > -Francisco > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Jun 11 09:36:53 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 11 Jun 2011 18:36:53 +0400 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 In-Reply-To: References: Message-ID: Hi Gustav -- That was "miPtySing". I meant .NET Framework's built-in System.TimeSpan struct not TimeStamp (which doesn't exist). I typed my code snippet from memory and my "brainputer"'s memory obviously "got a Glueck" after a heavy duty working day of a large batch of VS2008 projects conversion to VS2010. Correct sample code snippet should have been something like the following: // Define TimeSpan value equal to // 10 hours 11 minutes and 12 seconds TimeSpan ts = new TimeSpan(10, 11, 12); // correct TimeSpan value formatting string s = string.Format("Correct = {0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); // incorrect TimeSpan value formatting try { s = string.Format("Incorrect = {0:hh:mm:ss}", ts); System.Console.WriteLine(s); } catch (Exception ex) { System.Console.WriteLine("Error: {0}", ex.Message); } Thank you. -- Shamil P.S. Sorry for delay with my reply - I've got a short vacation immediately after I have posted to Access-D my original posting... -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ???? 2011 ?. 14:08 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From gustav at cactus.dk Sat Jun 11 17:30:44 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 12 Jun 2011 00:30:44 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil Ha ha, "got a Glueck", that explains! /gustav >>> shamil at smsconsulting.spb.ru 11-06-2011 16:36 >>> Hi Gustav -- That was "miPtySing". I meant .NET Framework's built-in System.TimeSpan struct not TimeStamp (which doesn't exist). I typed my code snippet from memory and my "brainputer"'s memory obviously "got a Glueck" after a heavy duty working day of a large batch of VS2008 projects conversion to VS2010. Correct sample code snippet should have been something like the following: // Define TimeSpan value equal to // 10 hours 11 minutes and 12 seconds TimeSpan ts = new TimeSpan(10, 11, 12); // correct TimeSpan value formatting string s = string.Format("Correct = {0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); // incorrect TimeSpan value formatting try { s = string.Format("Incorrect = {0:hh:mm:ss}", ts); System.Console.WriteLine(s); } catch (Exception ex) { System.Console.WriteLine("Error: {0}", ex.Message); } Thank you. -- Shamil P.S. Sorry for delay with my reply - I've got a short vacation immediately after I have posted to Access-D my original posting... -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ???? 2011 ?. 14:08 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From fhtapia at gmail.com Mon Jun 13 14:37:38 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 13 Jun 2011 12:37:38 -0700 Subject: [dba-VB] closing your connections In-Reply-To: References: Message-ID: I'm not sure, I am closing and disposing my objects as I posted in my first post... but if I monitor the sql server I notice that the connection is still active.(in awaiting sleep status but connected) :-/ -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Wed, Jun 8, 2011 at 10:22 AM, David McAfee wrote: > This is what I do with SQLCE when I need to modify the SDF, which shouldn't > differ too much from SQL Server: > > Dim strCEconn As String = "Data Source = " & strPath & strFileName > Dim CEconn As SqlServerCe.SqlCeConnection = New > SqlServerCe.SqlCeConnection(strCEconn) > CEconn.Open() > Dim CEcmd As SqlServerCe.SqlCeCommand = CEconn.CreateCommand > > CEcmd.CommandText = "CREATE TABLE InvoiceOrderJunct([InvNo] > [nvarchar](8) NULL, [OrderID] [int], [AMNo] [nvarchar](10) NULL)" > CEcmd.ExecuteNonQuery() > > CEcmd.Dispose() > CEconn.Close() > CEconn.Dispose() > > > I had to do this in one of my webservice functions, when we had weird > issues: > > > _ > Public Function InsertInvHdr(ByVal strInput As String, ByVal dsIn As > DataSet) As String > > Dim errNum As Integer > Dim errMsg As String > Dim myConnection As SqlConnection > Dim myCommand As SqlCommand > Dim row As DataRow > > Call fUnSecureString(strInput) > > Try > 'Following parameters are determined from strInput hash saved as > global variables > myConnection = New SqlConnection("server=" & ServerName & > ";uid=" & strUid & ";pwd=" & strPw& ";database=" & strDBname) > myConnection.Open() > myCommand = New SqlCommand > myCommand.Connection = myConnection > > For Each row In dsIn.Tables(0).Rows > myCommand.CommandText = "EXEC stpInsertIntoInvHdr '" & > row("ICNo").ToString() & "', '" & row("StoreNo").ToString() & "', '" & > row("CustNo").ToString() > myCommand.ExecuteNonQuery() > Next > > Return "InvHdr data inserted" > 'myConnection.Close() > > '****************************************************************** > ' Added the 2 IF statements below on 8/4/2010 to see if it > clears out sleeping processes > If (Not (myCommand) Is Nothing) Then > myCommand.Dispose() > myCommand = Nothing > End If > If (Not (myConnection) Is Nothing) Then > myConnection.Close() > End If > '******************************************************** > Catch ex As Exception > errNum = Err.Number > errMsg = ex.Message > Return "SQL/WS Error: WS.InsertInvHdr - " & errNum & ":" & > errMsg > 'Finally > ' myConnection.Close() > End Try > End Function > > > > On Wed, Jun 8, 2011 at 8:47 AM, Francisco Tapia wrote: > > > so I have a vb.net app (visual studio 2008) and I am making some sproc > > calls > > like so: > > > > > > conn = New SqlConnection(My.MySettings.Default.dbConn) > > cmd = New SqlCommand("dbo.stp_PCO", conn) > > cmd.CommandType = CommandType.StoredProcedure > > conn.Open() > > da.SelectCommand = cmd > > da.Fill(dtCTable) > > > > I've also tried closing my connections after usage by using the following > > closing statments > > > > dtCtable.Dispose() > > dtClockTable = nothing > > cmd.Dispose() > > cmd = nothing > > da.Dispose() > > da = nothing > > conn.close() > > conn.Dispose() > > conn = nothing > > > > but when I check my sql server I still see sleeping entires in the > activity > > monitor suggesting that a connection is still active. How do I sever the > > connection completely? I know a connection is alive and well because I > > noticed that if I completely close the application the connection goes > from > > sleeping to gone. I want my connections to close once the data has been > > retrieved to allow the server to reuse that memory if needed. > > > > in vb 6 it used to be so simple with just ado :( > > > > your help is of course appreciated! > > > > > > -Francisco > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jun 14 15:06:10 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 14 Jun 2011 16:06:10 -0400 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 Message-ID: <4DF7BF32.1090405@colbyconsulting.com> It has finally arrived! -- John W. Colby www.ColbyConsulting.com http://techreport.com/articles.x/16255 From fhtapia at gmail.com Thu Jun 16 10:58:04 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 16 Jun 2011 08:58:04 -0700 Subject: [dba-VB] A windows Service or Not a service? Message-ID: I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stationsand Desktopsin the Platform SDK documentation. -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) From jwcolby at colbyconsulting.com Thu Jun 16 11:32:25 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Jun 2011 12:32:25 -0400 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: <4DFA3019.7020109@colbyconsulting.com> I too need to know this. A service cannot directly support a user interface because if there is no one logged in there is no place to put the user interface (no screen to draw it). My guess is that the user interface somehow calls functions to get information, or perhaps hooks a data "service" channel to read / write to the service application. John W. Colby www.ColbyConsulting.com On 6/16/2011 11:58 AM, Francisco Tapia wrote: > I wrote a simple application that has a form and two buttons (along with a > timer). My initial idea was that I would write this to be a windows service > so it would auto-start whenever a specific server would reboot etc. The > purpose is that I need to get new records created by a "Vendor" application > and have them sent to a Second "Vendor" system. I call a custom view that I > wrote that collects that last set of changes, then record by record calls a > webservice on our SAP system and pushes in the new changes. My sql server > version is Sql Server 2000 so it's not as easy as just writing a soap object > to make the webservice call, I think it was much easier to just write the > app in c# and make the call that way, which works. NOW for the tricky > part. I wanted to write up the app to create a windows service installer so > that my admins could log into the windows server and either start or stop > the application, I also wanted to provide a gui view to the windows service > so that they could choose a different timer so it could run every 1 minute > (every 2 minutes, etc..) what ever they would choose. > > after reading MS's description on windows service classes, I noticed that > supposedly the .Net Studio does not support this, but I've seen other apps > that DO provide a gui view to the windows service that they introduce. so > my question to the group is, have you done this before? and if so how did > you go about it? > > -- > http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx > > The Windows service classes supported by the .NET Framework do not support > interaction with interactive stations, that is, the logged-on user. The .NET > Framework also does not include classes that represent stations and > desktops. If your Windows service must interact with other stations, you > will need to access the unmanaged Windows API. For more information, see Window > Stationsand > Desktopsin > the Platform SDK documentation. > > > -Francisco > http://bit.ly/sqlthis | Tsql and More... > http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From fhtapia at gmail.com Thu Jun 16 11:35:09 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 16 Jun 2011 09:35:09 -0700 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: <4DFA3019.7020109@colbyconsulting.com> References: <4DFA3019.7020109@colbyconsulting.com> Message-ID: I'm wondering about that too, does that mean that I need to package "2" applications? one service with a port that will talk to the gui so that a user can modify a specific setting (namely, how often it checks for new records). -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Thu, Jun 16, 2011 at 9:32 AM, jwcolby wrote: > I too need to know this. A service cannot directly support a user > interface because if there is no one logged in there is no place to put the > user interface (no screen to draw it). My guess is that the user interface > somehow calls functions to get information, or perhaps hooks a data > "service" channel to read / write to the service application. > > John W. Colby > www.ColbyConsulting.com > > > On 6/16/2011 11:58 AM, Francisco Tapia wrote: > >> I wrote a simple application that has a form and two buttons (along with a >> timer). My initial idea was that I would write this to be a windows >> service >> so it would auto-start whenever a specific server would reboot etc. The >> purpose is that I need to get new records created by a "Vendor" >> application >> and have them sent to a Second "Vendor" system. I call a custom view that >> I >> wrote that collects that last set of changes, then record by record calls >> a >> webservice on our SAP system and pushes in the new changes. My sql server >> version is Sql Server 2000 so it's not as easy as just writing a soap >> object >> to make the webservice call, I think it was much easier to just write the >> app in c# and make the call that way, which works. NOW for the tricky >> part. I wanted to write up the app to create a windows service installer >> so >> that my admins could log into the windows server and either start or stop >> the application, I also wanted to provide a gui view to the windows >> service >> so that they could choose a different timer so it could run every 1 minute >> (every 2 minutes, etc..) what ever they would choose. >> >> after reading MS's description on windows service classes, I noticed that >> supposedly the .Net Studio does not support this, but I've seen other apps >> that DO provide a gui view to the windows service that they introduce. so >> my question to the group is, have you done this before? and if so how did >> you go about it? >> >> -- >> http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx >> >> The Windows service classes supported by the .NET Framework do not support >> interaction with interactive stations, that is, the logged-on user. The >> .NET >> Framework also does not include classes that represent stations and >> desktops. If your Windows service must interact with other stations, you >> will need to access the unmanaged Windows API. For more information, see >> Window >> Stations< >> http://msdn.microsoft.com/en-us/library/ms687096%28v=VS.90%29.aspx>and >> Desktops< >> http://msdn.microsoft.com/en-us/library/ms682573%28v=VS.90%29.aspx>in >> >> the Platform SDK documentation. >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> >> _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From dw-murphy at cox.net Thu Jun 16 12:38:47 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 16 Jun 2011 10:38:47 -0700 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: <4DFA3019.7020109@colbyconsulting.com> Message-ID: <009601cc2c4c$3f663020$be329060$@cox.net> How about having a little config file that goes along with the service that you could edit in notepad or xml note pad since .NET loves xml files. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, June 16, 2011 9:35 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] A windows Service or Not a service? I'm wondering about that too, does that mean that I need to package "2" applications? one service with a port that will talk to the gui so that a user can modify a specific setting (namely, how often it checks for new records). -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Thu, Jun 16, 2011 at 9:32 AM, jwcolby wrote: > I too need to know this. A service cannot directly support a user > interface because if there is no one logged in there is no place to > put the user interface (no screen to draw it). My guess is that the > user interface somehow calls functions to get information, or perhaps > hooks a data "service" channel to read / write to the service application. > > John W. Colby > www.ColbyConsulting.com > > > On 6/16/2011 11:58 AM, Francisco Tapia wrote: > >> I wrote a simple application that has a form and two buttons (along >> with a timer). My initial idea was that I would write this to be a >> windows service so it would auto-start whenever a specific server >> would reboot etc. The purpose is that I need to get new records >> created by a "Vendor" >> application >> and have them sent to a Second "Vendor" system. I call a custom view >> that I wrote that collects that last set of changes, then record by >> record calls a webservice on our SAP system and pushes in the new >> changes. My sql server version is Sql Server 2000 so it's not as >> easy as just writing a soap object to make the webservice call, I >> think it was much easier to just write the app in c# and make the >> call that way, which works. NOW for the tricky part. I wanted to >> write up the app to create a windows service installer so that my >> admins could log into the windows server and either start or stop the >> application, I also wanted to provide a gui view to the windows >> service so that they could choose a different timer so it could run >> every 1 minute (every 2 minutes, etc..) what ever they would choose. >> >> after reading MS's description on windows service classes, I noticed >> that supposedly the .Net Studio does not support this, but I've seen >> other apps that DO provide a gui view to the windows service that >> they introduce. so my question to the group is, have you done this >> before? and if so how did you go about it? >> >> -- >> http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx >> >> The Windows service classes supported by the .NET Framework do not >> support interaction with interactive stations, that is, the logged-on >> user. The .NET Framework also does not include classes that represent >> stations and desktops. If your Windows service must interact with >> other stations, you will need to access the unmanaged Windows API. >> For more information, see Window Stations< >> http://msdn.microsoft.com/en-us/library/ms687096%28v=VS.90%29.aspx>an >> d >> Desktops< >> http://msdn.microsoft.com/en-us/library/ms682573%28v=VS.90%29.aspx>in >> >> the Platform SDK documentation. >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> >> _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 16 12:50:06 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 16 Jun 2011 21:50:06 +0400 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: <0466803437EC465DB77794C395A63253@nant> Hi Francisco, I have written a few real life WinServices working 24x7x365 for a few years. When a Windows Service Project is created its base class has code snippet as the following: public partial class MyService : ServiceBase { ... protected override void OnCustomCommand(int command) { switch(command) { case 503: CustomCommand503(); return; ... } } } It allows to define as many custom commands as you wanted to have. You comunicate with a Windows Service using that custom commands' IDs - here is a code snippet showing how to find your installed and runing Windows Service and to pass to it your custom command ID: public static void RunCustomServiceCommand(string serviceName, int commandId) { foreach (System.ServiceProcess.ServiceController service in System.ServiceProcess.ServiceController.GetServices()) { // juts a test output - commented it when not needed System.Console.WriteLine("[{0}].[{1}].[{2}]", service.MachineName, service.ServiceName, service.DisplayName); if (string.Compare(service.ServiceName, serviceName, true) == 0) { service.ExecuteCommand(commandId); } } } When I need to pass to a Windows Service more parameters than command id then I use inderect/intermediate media: files, database tables, ... Another issue is to smoothly install, run, stop, uninstall a Windows service - there should be more info on Internet and MSDN about that issues... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: 16 ???? 2011 ?. 19:58 To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] A windows Service or Not a service? I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stations and Desktops in the Platform SDK documentation. -Francisco From DWUTKA at Marlow.com Thu Jun 16 17:08:46 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 16 Jun 2011 17:08:46 -0500 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: An NT Service (as you are calling it a Windows Service) is an executable that is running on your machine and it has several different 'properties'. First, the type of startup... either manual, disabled or automatic. Automatic starts when you computer starts. Disabled means the service won't start. Secondly, there is an 'interactive' option, that determines if a service can run with an interface. For this to work, it has to have user credentials. Services with a user interface can run into all sorts of issues. I personally haven't built a service in .net yet, but have had lots of experience with them in VB 6. What you really want to do is build a service that has no interface, and then build a program that 'controls' that program. This can be done in many ways, either you can have the control change values in a database or file, that the service utilizes, or you can create various 'talking' methods, like named pipes, tcp/ip comms, etc, that allows the controlling program to directly talk to the service. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, June 16, 2011 10:58 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] A windows Service or Not a service? I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stationsand Desktopsin the Platform SDK documentation. -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From john at winhaven.net Mon Jun 20 14:02:12 2011 From: john at winhaven.net (John Bartow) Date: Mon, 20 Jun 2011 14:02:12 -0500 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <4DF7BF32.1090405@colbyconsulting.com> References: <4DF7BF32.1090405@colbyconsulting.com> Message-ID: <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> JC, Have you put in your order yet? http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% 20Solid%20State%20Drive&idno_no=270 John B -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, June 14, 2011 3:06 PM To: Access Developers discussion and problem solving; VBA; Sqlserver-Dba Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 It has finally arrived! http://techreport.com/articles.x/16255 From jwcolby at colbyconsulting.com Mon Jun 20 14:06:57 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Jun 2011 15:06:57 -0400 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> References: <4DF7BF32.1090405@colbyconsulting.com> <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> Message-ID: <4DFF9A51.60503@colbyconsulting.com> Nope, too much money for me. If they would do it for $199 I would have it on order already. John W. Colby www.ColbyConsulting.com On 6/20/2011 3:02 PM, John Bartow wrote: > http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% > 20Solid%20State%20Drive&idno_no=270 > From john at winhaven.net Mon Jun 20 14:17:41 2011 From: john at winhaven.net (John Bartow) Date: Mon, 20 Jun 2011 14:17:41 -0500 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <4DFF9A51.60503@colbyconsulting.com> References: <4DF7BF32.1090405@colbyconsulting.com> <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> <4DFF9A51.60503@colbyconsulting.com> Message-ID: <002701cc2f7e$b9cb6080$2d622180$@winhaven.net> LOL! Give it a couple of months. It'll be on clearance at Fry's. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, June 20, 2011 2:07 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 Nope, too much money for me. If they would do it for $199 I would have it on order already. John W. Colby www.ColbyConsulting.com On 6/20/2011 3:02 PM, John Bartow wrote: > http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% > 20Solid%20State%20Drive&idno_no=270 > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sun Jun 5 15:12:43 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Jun 2011 00:12:43 +0400 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: <91E8E248DC5845CBA678F51B568217E5@nant> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From Gustav at cactus.dk Mon Jun 6 04:41:52 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 11:41:52 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil So what you try to tell ... is that a colon on its own now is reserved for the use as the separator between the value and the format string? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From stuart at lexacorp.com.pg Mon Jun 6 04:57:15 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 06 Jun 2011 19:57:15 +1000 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 In-Reply-To: References: Message-ID: <4DECA47B.29763.1FEC6F0@stuart.lexacorp.com.pg> Not just the colon, any separator: The custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, "dd\.hh\:mm" defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours and minutes. -- Stuart On 6 Jun 2011 at 11:41, Gustav Brock wrote: > Hi Shamil > > So what you try to tell ... is that a colon on its own now is reserved > for the use as the separator between the value and the format string? > > /gustav > > > >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> > Hi All -- > > FYI: I have got used to format TimeStamp values this simple way (for > TimeStamp values less than a day): > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh:mm:ss}", ts); > System.Console.WriteLine(s); > > and it worked well for VS2008/.NET 3.5 but when my project was > converted to VS2010SP1/.NET 4.0 I have got runtime error... > > Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh\\:mm\\:ss}", ts); > System.Console.WriteLine(s); > > Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx > > Thank you. > > -- > Shamil > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Mon Jun 6 05:07:46 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 12:07:46 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From Gustav at cactus.dk Mon Jun 6 06:07:05 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 13:07:05 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Stuart Well, yes for the format string, but "any" separator is not (can not) be used to separate the value and the format string; it has to be a colon: string s = string.Format("{0:hh\\:mm\\:ss}", ts); /gustav >>> "Stuart McLachlan" 06-06-2011 11:57 >>> Not just the colon, any separator: The custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, "dd\.hh\:mm" defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours and minutes. -- Stuart On 6 Jun 2011 at 11:41, Gustav Brock wrote: > Hi Shamil > > So what you try to tell ... is that a colon on its own now is reserved > for the use as the separator between the value and the format string? > > /gustav > > > >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> > Hi All -- > > FYI: I have got used to format TimeStamp values this simple way (for > TimeStamp values less than a day): > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh:mm:ss}", ts); > System.Console.WriteLine(s); > > and it worked well for VS2008/.NET 3.5 but when my project was > converted to VS2010SP1/.NET 4.0 I have got runtime error... > > Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh\\:mm\\:ss}", ts); > System.Console.WriteLine(s); > > Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx > > Thank you. > > -- > Shamil From fhtapia at gmail.com Wed Jun 8 10:47:35 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 8 Jun 2011 08:47:35 -0700 Subject: [dba-VB] closing your connections Message-ID: so I have a vb.net app (visual studio 2008) and I am making some sproc calls like so: conn = New SqlConnection(My.MySettings.Default.dbConn) cmd = New SqlCommand("dbo.stp_PCO", conn) cmd.CommandType = CommandType.StoredProcedure conn.Open() da.SelectCommand = cmd da.Fill(dtCTable) I've also tried closing my connections after usage by using the following closing statments dtCtable.Dispose() dtClockTable = nothing cmd.Dispose() cmd = nothing da.Dispose() da = nothing conn.close() conn.Dispose() conn = nothing but when I check my sql server I still see sleeping entires in the activity monitor suggesting that a connection is still active. How do I sever the connection completely? I know a connection is alive and well because I noticed that if I completely close the application the connection goes from sleeping to gone. I want my connections to close once the data has been retrieved to allow the server to reuse that memory if needed. in vb 6 it used to be so simple with just ado :( your help is of course appreciated! -Francisco From davidmcafee at gmail.com Wed Jun 8 12:22:21 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 8 Jun 2011 10:22:21 -0700 Subject: [dba-VB] closing your connections In-Reply-To: References: Message-ID: This is what I do with SQLCE when I need to modify the SDF, which shouldn't differ too much from SQL Server: Dim strCEconn As String = "Data Source = " & strPath & strFileName Dim CEconn As SqlServerCe.SqlCeConnection = New SqlServerCe.SqlCeConnection(strCEconn) CEconn.Open() Dim CEcmd As SqlServerCe.SqlCeCommand = CEconn.CreateCommand CEcmd.CommandText = "CREATE TABLE InvoiceOrderJunct([InvNo] [nvarchar](8) NULL, [OrderID] [int], [AMNo] [nvarchar](10) NULL)" CEcmd.ExecuteNonQuery() CEcmd.Dispose() CEconn.Close() CEconn.Dispose() I had to do this in one of my webservice functions, when we had weird issues: _ Public Function InsertInvHdr(ByVal strInput As String, ByVal dsIn As DataSet) As String Dim errNum As Integer Dim errMsg As String Dim myConnection As SqlConnection Dim myCommand As SqlCommand Dim row As DataRow Call fUnSecureString(strInput) Try 'Following parameters are determined from strInput hash saved as global variables myConnection = New SqlConnection("server=" & ServerName & ";uid=" & strUid & ";pwd=" & strPw& ";database=" & strDBname) myConnection.Open() myCommand = New SqlCommand myCommand.Connection = myConnection For Each row In dsIn.Tables(0).Rows myCommand.CommandText = "EXEC stpInsertIntoInvHdr '" & row("ICNo").ToString() & "', '" & row("StoreNo").ToString() & "', '" & row("CustNo").ToString() myCommand.ExecuteNonQuery() Next Return "InvHdr data inserted" 'myConnection.Close() '****************************************************************** ' Added the 2 IF statements below on 8/4/2010 to see if it clears out sleeping processes If (Not (myCommand) Is Nothing) Then myCommand.Dispose() myCommand = Nothing End If If (Not (myConnection) Is Nothing) Then myConnection.Close() End If '******************************************************** Catch ex As Exception errNum = Err.Number errMsg = ex.Message Return "SQL/WS Error: WS.InsertInvHdr - " & errNum & ":" & errMsg 'Finally ' myConnection.Close() End Try End Function On Wed, Jun 8, 2011 at 8:47 AM, Francisco Tapia wrote: > so I have a vb.net app (visual studio 2008) and I am making some sproc > calls > like so: > > > conn = New SqlConnection(My.MySettings.Default.dbConn) > cmd = New SqlCommand("dbo.stp_PCO", conn) > cmd.CommandType = CommandType.StoredProcedure > conn.Open() > da.SelectCommand = cmd > da.Fill(dtCTable) > > I've also tried closing my connections after usage by using the following > closing statments > > dtCtable.Dispose() > dtClockTable = nothing > cmd.Dispose() > cmd = nothing > da.Dispose() > da = nothing > conn.close() > conn.Dispose() > conn = nothing > > but when I check my sql server I still see sleeping entires in the activity > monitor suggesting that a connection is still active. How do I sever the > connection completely? I know a connection is alive and well because I > noticed that if I completely close the application the connection goes from > sleeping to gone. I want my connections to close once the data has been > retrieved to allow the server to reuse that memory if needed. > > in vb 6 it used to be so simple with just ado :( > > your help is of course appreciated! > > > -Francisco > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Jun 11 09:36:53 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 11 Jun 2011 18:36:53 +0400 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 In-Reply-To: References: Message-ID: Hi Gustav -- That was "miPtySing". I meant .NET Framework's built-in System.TimeSpan struct not TimeStamp (which doesn't exist). I typed my code snippet from memory and my "brainputer"'s memory obviously "got a Glueck" after a heavy duty working day of a large batch of VS2008 projects conversion to VS2010. Correct sample code snippet should have been something like the following: // Define TimeSpan value equal to // 10 hours 11 minutes and 12 seconds TimeSpan ts = new TimeSpan(10, 11, 12); // correct TimeSpan value formatting string s = string.Format("Correct = {0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); // incorrect TimeSpan value formatting try { s = string.Format("Incorrect = {0:hh:mm:ss}", ts); System.Console.WriteLine(s); } catch (Exception ex) { System.Console.WriteLine("Error: {0}", ex.Message); } Thank you. -- Shamil P.S. Sorry for delay with my reply - I've got a short vacation immediately after I have posted to Access-D my original posting... -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ???? 2011 ?. 14:08 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From gustav at cactus.dk Sat Jun 11 17:30:44 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 12 Jun 2011 00:30:44 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil Ha ha, "got a Glueck", that explains! /gustav >>> shamil at smsconsulting.spb.ru 11-06-2011 16:36 >>> Hi Gustav -- That was "miPtySing". I meant .NET Framework's built-in System.TimeSpan struct not TimeStamp (which doesn't exist). I typed my code snippet from memory and my "brainputer"'s memory obviously "got a Glueck" after a heavy duty working day of a large batch of VS2008 projects conversion to VS2010. Correct sample code snippet should have been something like the following: // Define TimeSpan value equal to // 10 hours 11 minutes and 12 seconds TimeSpan ts = new TimeSpan(10, 11, 12); // correct TimeSpan value formatting string s = string.Format("Correct = {0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); // incorrect TimeSpan value formatting try { s = string.Format("Incorrect = {0:hh:mm:ss}", ts); System.Console.WriteLine(s); } catch (Exception ex) { System.Console.WriteLine("Error: {0}", ex.Message); } Thank you. -- Shamil P.S. Sorry for delay with my reply - I've got a short vacation immediately after I have posted to Access-D my original posting... -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ???? 2011 ?. 14:08 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From fhtapia at gmail.com Mon Jun 13 14:37:38 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 13 Jun 2011 12:37:38 -0700 Subject: [dba-VB] closing your connections In-Reply-To: References: Message-ID: I'm not sure, I am closing and disposing my objects as I posted in my first post... but if I monitor the sql server I notice that the connection is still active.(in awaiting sleep status but connected) :-/ -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Wed, Jun 8, 2011 at 10:22 AM, David McAfee wrote: > This is what I do with SQLCE when I need to modify the SDF, which shouldn't > differ too much from SQL Server: > > Dim strCEconn As String = "Data Source = " & strPath & strFileName > Dim CEconn As SqlServerCe.SqlCeConnection = New > SqlServerCe.SqlCeConnection(strCEconn) > CEconn.Open() > Dim CEcmd As SqlServerCe.SqlCeCommand = CEconn.CreateCommand > > CEcmd.CommandText = "CREATE TABLE InvoiceOrderJunct([InvNo] > [nvarchar](8) NULL, [OrderID] [int], [AMNo] [nvarchar](10) NULL)" > CEcmd.ExecuteNonQuery() > > CEcmd.Dispose() > CEconn.Close() > CEconn.Dispose() > > > I had to do this in one of my webservice functions, when we had weird > issues: > > > _ > Public Function InsertInvHdr(ByVal strInput As String, ByVal dsIn As > DataSet) As String > > Dim errNum As Integer > Dim errMsg As String > Dim myConnection As SqlConnection > Dim myCommand As SqlCommand > Dim row As DataRow > > Call fUnSecureString(strInput) > > Try > 'Following parameters are determined from strInput hash saved as > global variables > myConnection = New SqlConnection("server=" & ServerName & > ";uid=" & strUid & ";pwd=" & strPw& ";database=" & strDBname) > myConnection.Open() > myCommand = New SqlCommand > myCommand.Connection = myConnection > > For Each row In dsIn.Tables(0).Rows > myCommand.CommandText = "EXEC stpInsertIntoInvHdr '" & > row("ICNo").ToString() & "', '" & row("StoreNo").ToString() & "', '" & > row("CustNo").ToString() > myCommand.ExecuteNonQuery() > Next > > Return "InvHdr data inserted" > 'myConnection.Close() > > '****************************************************************** > ' Added the 2 IF statements below on 8/4/2010 to see if it > clears out sleeping processes > If (Not (myCommand) Is Nothing) Then > myCommand.Dispose() > myCommand = Nothing > End If > If (Not (myConnection) Is Nothing) Then > myConnection.Close() > End If > '******************************************************** > Catch ex As Exception > errNum = Err.Number > errMsg = ex.Message > Return "SQL/WS Error: WS.InsertInvHdr - " & errNum & ":" & > errMsg > 'Finally > ' myConnection.Close() > End Try > End Function > > > > On Wed, Jun 8, 2011 at 8:47 AM, Francisco Tapia wrote: > > > so I have a vb.net app (visual studio 2008) and I am making some sproc > > calls > > like so: > > > > > > conn = New SqlConnection(My.MySettings.Default.dbConn) > > cmd = New SqlCommand("dbo.stp_PCO", conn) > > cmd.CommandType = CommandType.StoredProcedure > > conn.Open() > > da.SelectCommand = cmd > > da.Fill(dtCTable) > > > > I've also tried closing my connections after usage by using the following > > closing statments > > > > dtCtable.Dispose() > > dtClockTable = nothing > > cmd.Dispose() > > cmd = nothing > > da.Dispose() > > da = nothing > > conn.close() > > conn.Dispose() > > conn = nothing > > > > but when I check my sql server I still see sleeping entires in the > activity > > monitor suggesting that a connection is still active. How do I sever the > > connection completely? I know a connection is alive and well because I > > noticed that if I completely close the application the connection goes > from > > sleeping to gone. I want my connections to close once the data has been > > retrieved to allow the server to reuse that memory if needed. > > > > in vb 6 it used to be so simple with just ado :( > > > > your help is of course appreciated! > > > > > > -Francisco > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jun 14 15:06:10 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 14 Jun 2011 16:06:10 -0400 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 Message-ID: <4DF7BF32.1090405@colbyconsulting.com> It has finally arrived! -- John W. Colby www.ColbyConsulting.com http://techreport.com/articles.x/16255 From fhtapia at gmail.com Thu Jun 16 10:58:04 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 16 Jun 2011 08:58:04 -0700 Subject: [dba-VB] A windows Service or Not a service? Message-ID: I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stationsand Desktopsin the Platform SDK documentation. -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) From jwcolby at colbyconsulting.com Thu Jun 16 11:32:25 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Jun 2011 12:32:25 -0400 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: <4DFA3019.7020109@colbyconsulting.com> I too need to know this. A service cannot directly support a user interface because if there is no one logged in there is no place to put the user interface (no screen to draw it). My guess is that the user interface somehow calls functions to get information, or perhaps hooks a data "service" channel to read / write to the service application. John W. Colby www.ColbyConsulting.com On 6/16/2011 11:58 AM, Francisco Tapia wrote: > I wrote a simple application that has a form and two buttons (along with a > timer). My initial idea was that I would write this to be a windows service > so it would auto-start whenever a specific server would reboot etc. The > purpose is that I need to get new records created by a "Vendor" application > and have them sent to a Second "Vendor" system. I call a custom view that I > wrote that collects that last set of changes, then record by record calls a > webservice on our SAP system and pushes in the new changes. My sql server > version is Sql Server 2000 so it's not as easy as just writing a soap object > to make the webservice call, I think it was much easier to just write the > app in c# and make the call that way, which works. NOW for the tricky > part. I wanted to write up the app to create a windows service installer so > that my admins could log into the windows server and either start or stop > the application, I also wanted to provide a gui view to the windows service > so that they could choose a different timer so it could run every 1 minute > (every 2 minutes, etc..) what ever they would choose. > > after reading MS's description on windows service classes, I noticed that > supposedly the .Net Studio does not support this, but I've seen other apps > that DO provide a gui view to the windows service that they introduce. so > my question to the group is, have you done this before? and if so how did > you go about it? > > -- > http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx > > The Windows service classes supported by the .NET Framework do not support > interaction with interactive stations, that is, the logged-on user. The .NET > Framework also does not include classes that represent stations and > desktops. If your Windows service must interact with other stations, you > will need to access the unmanaged Windows API. For more information, see Window > Stationsand > Desktopsin > the Platform SDK documentation. > > > -Francisco > http://bit.ly/sqlthis | Tsql and More... > http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From fhtapia at gmail.com Thu Jun 16 11:35:09 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 16 Jun 2011 09:35:09 -0700 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: <4DFA3019.7020109@colbyconsulting.com> References: <4DFA3019.7020109@colbyconsulting.com> Message-ID: I'm wondering about that too, does that mean that I need to package "2" applications? one service with a port that will talk to the gui so that a user can modify a specific setting (namely, how often it checks for new records). -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Thu, Jun 16, 2011 at 9:32 AM, jwcolby wrote: > I too need to know this. A service cannot directly support a user > interface because if there is no one logged in there is no place to put the > user interface (no screen to draw it). My guess is that the user interface > somehow calls functions to get information, or perhaps hooks a data > "service" channel to read / write to the service application. > > John W. Colby > www.ColbyConsulting.com > > > On 6/16/2011 11:58 AM, Francisco Tapia wrote: > >> I wrote a simple application that has a form and two buttons (along with a >> timer). My initial idea was that I would write this to be a windows >> service >> so it would auto-start whenever a specific server would reboot etc. The >> purpose is that I need to get new records created by a "Vendor" >> application >> and have them sent to a Second "Vendor" system. I call a custom view that >> I >> wrote that collects that last set of changes, then record by record calls >> a >> webservice on our SAP system and pushes in the new changes. My sql server >> version is Sql Server 2000 so it's not as easy as just writing a soap >> object >> to make the webservice call, I think it was much easier to just write the >> app in c# and make the call that way, which works. NOW for the tricky >> part. I wanted to write up the app to create a windows service installer >> so >> that my admins could log into the windows server and either start or stop >> the application, I also wanted to provide a gui view to the windows >> service >> so that they could choose a different timer so it could run every 1 minute >> (every 2 minutes, etc..) what ever they would choose. >> >> after reading MS's description on windows service classes, I noticed that >> supposedly the .Net Studio does not support this, but I've seen other apps >> that DO provide a gui view to the windows service that they introduce. so >> my question to the group is, have you done this before? and if so how did >> you go about it? >> >> -- >> http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx >> >> The Windows service classes supported by the .NET Framework do not support >> interaction with interactive stations, that is, the logged-on user. The >> .NET >> Framework also does not include classes that represent stations and >> desktops. If your Windows service must interact with other stations, you >> will need to access the unmanaged Windows API. For more information, see >> Window >> Stations< >> http://msdn.microsoft.com/en-us/library/ms687096%28v=VS.90%29.aspx>and >> Desktops< >> http://msdn.microsoft.com/en-us/library/ms682573%28v=VS.90%29.aspx>in >> >> the Platform SDK documentation. >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> >> _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From dw-murphy at cox.net Thu Jun 16 12:38:47 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 16 Jun 2011 10:38:47 -0700 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: <4DFA3019.7020109@colbyconsulting.com> Message-ID: <009601cc2c4c$3f663020$be329060$@cox.net> How about having a little config file that goes along with the service that you could edit in notepad or xml note pad since .NET loves xml files. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, June 16, 2011 9:35 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] A windows Service or Not a service? I'm wondering about that too, does that mean that I need to package "2" applications? one service with a port that will talk to the gui so that a user can modify a specific setting (namely, how often it checks for new records). -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Thu, Jun 16, 2011 at 9:32 AM, jwcolby wrote: > I too need to know this. A service cannot directly support a user > interface because if there is no one logged in there is no place to > put the user interface (no screen to draw it). My guess is that the > user interface somehow calls functions to get information, or perhaps > hooks a data "service" channel to read / write to the service application. > > John W. Colby > www.ColbyConsulting.com > > > On 6/16/2011 11:58 AM, Francisco Tapia wrote: > >> I wrote a simple application that has a form and two buttons (along >> with a timer). My initial idea was that I would write this to be a >> windows service so it would auto-start whenever a specific server >> would reboot etc. The purpose is that I need to get new records >> created by a "Vendor" >> application >> and have them sent to a Second "Vendor" system. I call a custom view >> that I wrote that collects that last set of changes, then record by >> record calls a webservice on our SAP system and pushes in the new >> changes. My sql server version is Sql Server 2000 so it's not as >> easy as just writing a soap object to make the webservice call, I >> think it was much easier to just write the app in c# and make the >> call that way, which works. NOW for the tricky part. I wanted to >> write up the app to create a windows service installer so that my >> admins could log into the windows server and either start or stop the >> application, I also wanted to provide a gui view to the windows >> service so that they could choose a different timer so it could run >> every 1 minute (every 2 minutes, etc..) what ever they would choose. >> >> after reading MS's description on windows service classes, I noticed >> that supposedly the .Net Studio does not support this, but I've seen >> other apps that DO provide a gui view to the windows service that >> they introduce. so my question to the group is, have you done this >> before? and if so how did you go about it? >> >> -- >> http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx >> >> The Windows service classes supported by the .NET Framework do not >> support interaction with interactive stations, that is, the logged-on >> user. The .NET Framework also does not include classes that represent >> stations and desktops. If your Windows service must interact with >> other stations, you will need to access the unmanaged Windows API. >> For more information, see Window Stations< >> http://msdn.microsoft.com/en-us/library/ms687096%28v=VS.90%29.aspx>an >> d >> Desktops< >> http://msdn.microsoft.com/en-us/library/ms682573%28v=VS.90%29.aspx>in >> >> the Platform SDK documentation. >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> >> _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 16 12:50:06 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 16 Jun 2011 21:50:06 +0400 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: <0466803437EC465DB77794C395A63253@nant> Hi Francisco, I have written a few real life WinServices working 24x7x365 for a few years. When a Windows Service Project is created its base class has code snippet as the following: public partial class MyService : ServiceBase { ... protected override void OnCustomCommand(int command) { switch(command) { case 503: CustomCommand503(); return; ... } } } It allows to define as many custom commands as you wanted to have. You comunicate with a Windows Service using that custom commands' IDs - here is a code snippet showing how to find your installed and runing Windows Service and to pass to it your custom command ID: public static void RunCustomServiceCommand(string serviceName, int commandId) { foreach (System.ServiceProcess.ServiceController service in System.ServiceProcess.ServiceController.GetServices()) { // juts a test output - commented it when not needed System.Console.WriteLine("[{0}].[{1}].[{2}]", service.MachineName, service.ServiceName, service.DisplayName); if (string.Compare(service.ServiceName, serviceName, true) == 0) { service.ExecuteCommand(commandId); } } } When I need to pass to a Windows Service more parameters than command id then I use inderect/intermediate media: files, database tables, ... Another issue is to smoothly install, run, stop, uninstall a Windows service - there should be more info on Internet and MSDN about that issues... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: 16 ???? 2011 ?. 19:58 To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] A windows Service or Not a service? I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stations and Desktops in the Platform SDK documentation. -Francisco From DWUTKA at Marlow.com Thu Jun 16 17:08:46 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 16 Jun 2011 17:08:46 -0500 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: An NT Service (as you are calling it a Windows Service) is an executable that is running on your machine and it has several different 'properties'. First, the type of startup... either manual, disabled or automatic. Automatic starts when you computer starts. Disabled means the service won't start. Secondly, there is an 'interactive' option, that determines if a service can run with an interface. For this to work, it has to have user credentials. Services with a user interface can run into all sorts of issues. I personally haven't built a service in .net yet, but have had lots of experience with them in VB 6. What you really want to do is build a service that has no interface, and then build a program that 'controls' that program. This can be done in many ways, either you can have the control change values in a database or file, that the service utilizes, or you can create various 'talking' methods, like named pipes, tcp/ip comms, etc, that allows the controlling program to directly talk to the service. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, June 16, 2011 10:58 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] A windows Service or Not a service? I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stationsand Desktopsin the Platform SDK documentation. -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From john at winhaven.net Mon Jun 20 14:02:12 2011 From: john at winhaven.net (John Bartow) Date: Mon, 20 Jun 2011 14:02:12 -0500 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <4DF7BF32.1090405@colbyconsulting.com> References: <4DF7BF32.1090405@colbyconsulting.com> Message-ID: <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> JC, Have you put in your order yet? http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% 20Solid%20State%20Drive&idno_no=270 John B -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, June 14, 2011 3:06 PM To: Access Developers discussion and problem solving; VBA; Sqlserver-Dba Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 It has finally arrived! http://techreport.com/articles.x/16255 From jwcolby at colbyconsulting.com Mon Jun 20 14:06:57 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Jun 2011 15:06:57 -0400 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> References: <4DF7BF32.1090405@colbyconsulting.com> <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> Message-ID: <4DFF9A51.60503@colbyconsulting.com> Nope, too much money for me. If they would do it for $199 I would have it on order already. John W. Colby www.ColbyConsulting.com On 6/20/2011 3:02 PM, John Bartow wrote: > http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% > 20Solid%20State%20Drive&idno_no=270 > From john at winhaven.net Mon Jun 20 14:17:41 2011 From: john at winhaven.net (John Bartow) Date: Mon, 20 Jun 2011 14:17:41 -0500 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <4DFF9A51.60503@colbyconsulting.com> References: <4DF7BF32.1090405@colbyconsulting.com> <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> <4DFF9A51.60503@colbyconsulting.com> Message-ID: <002701cc2f7e$b9cb6080$2d622180$@winhaven.net> LOL! Give it a couple of months. It'll be on clearance at Fry's. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, June 20, 2011 2:07 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 Nope, too much money for me. If they would do it for $199 I would have it on order already. John W. Colby www.ColbyConsulting.com On 6/20/2011 3:02 PM, John Bartow wrote: > http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% > 20Solid%20State%20Drive&idno_no=270 > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sun Jun 5 15:12:43 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Jun 2011 00:12:43 +0400 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: <91E8E248DC5845CBA678F51B568217E5@nant> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From Gustav at cactus.dk Mon Jun 6 04:41:52 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 11:41:52 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil So what you try to tell ... is that a colon on its own now is reserved for the use as the separator between the value and the format string? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From stuart at lexacorp.com.pg Mon Jun 6 04:57:15 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 06 Jun 2011 19:57:15 +1000 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 In-Reply-To: References: Message-ID: <4DECA47B.29763.1FEC6F0@stuart.lexacorp.com.pg> Not just the colon, any separator: The custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, "dd\.hh\:mm" defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours and minutes. -- Stuart On 6 Jun 2011 at 11:41, Gustav Brock wrote: > Hi Shamil > > So what you try to tell ... is that a colon on its own now is reserved > for the use as the separator between the value and the format string? > > /gustav > > > >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> > Hi All -- > > FYI: I have got used to format TimeStamp values this simple way (for > TimeStamp values less than a day): > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh:mm:ss}", ts); > System.Console.WriteLine(s); > > and it worked well for VS2008/.NET 3.5 but when my project was > converted to VS2010SP1/.NET 4.0 I have got runtime error... > > Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh\\:mm\\:ss}", ts); > System.Console.WriteLine(s); > > Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx > > Thank you. > > -- > Shamil > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Mon Jun 6 05:07:46 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 12:07:46 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From Gustav at cactus.dk Mon Jun 6 06:07:05 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 13:07:05 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Stuart Well, yes for the format string, but "any" separator is not (can not) be used to separate the value and the format string; it has to be a colon: string s = string.Format("{0:hh\\:mm\\:ss}", ts); /gustav >>> "Stuart McLachlan" 06-06-2011 11:57 >>> Not just the colon, any separator: The custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, "dd\.hh\:mm" defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours and minutes. -- Stuart On 6 Jun 2011 at 11:41, Gustav Brock wrote: > Hi Shamil > > So what you try to tell ... is that a colon on its own now is reserved > for the use as the separator between the value and the format string? > > /gustav > > > >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> > Hi All -- > > FYI: I have got used to format TimeStamp values this simple way (for > TimeStamp values less than a day): > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh:mm:ss}", ts); > System.Console.WriteLine(s); > > and it worked well for VS2008/.NET 3.5 but when my project was > converted to VS2010SP1/.NET 4.0 I have got runtime error... > > Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh\\:mm\\:ss}", ts); > System.Console.WriteLine(s); > > Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx > > Thank you. > > -- > Shamil From fhtapia at gmail.com Wed Jun 8 10:47:35 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 8 Jun 2011 08:47:35 -0700 Subject: [dba-VB] closing your connections Message-ID: so I have a vb.net app (visual studio 2008) and I am making some sproc calls like so: conn = New SqlConnection(My.MySettings.Default.dbConn) cmd = New SqlCommand("dbo.stp_PCO", conn) cmd.CommandType = CommandType.StoredProcedure conn.Open() da.SelectCommand = cmd da.Fill(dtCTable) I've also tried closing my connections after usage by using the following closing statments dtCtable.Dispose() dtClockTable = nothing cmd.Dispose() cmd = nothing da.Dispose() da = nothing conn.close() conn.Dispose() conn = nothing but when I check my sql server I still see sleeping entires in the activity monitor suggesting that a connection is still active. How do I sever the connection completely? I know a connection is alive and well because I noticed that if I completely close the application the connection goes from sleeping to gone. I want my connections to close once the data has been retrieved to allow the server to reuse that memory if needed. in vb 6 it used to be so simple with just ado :( your help is of course appreciated! -Francisco From davidmcafee at gmail.com Wed Jun 8 12:22:21 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 8 Jun 2011 10:22:21 -0700 Subject: [dba-VB] closing your connections In-Reply-To: References: Message-ID: This is what I do with SQLCE when I need to modify the SDF, which shouldn't differ too much from SQL Server: Dim strCEconn As String = "Data Source = " & strPath & strFileName Dim CEconn As SqlServerCe.SqlCeConnection = New SqlServerCe.SqlCeConnection(strCEconn) CEconn.Open() Dim CEcmd As SqlServerCe.SqlCeCommand = CEconn.CreateCommand CEcmd.CommandText = "CREATE TABLE InvoiceOrderJunct([InvNo] [nvarchar](8) NULL, [OrderID] [int], [AMNo] [nvarchar](10) NULL)" CEcmd.ExecuteNonQuery() CEcmd.Dispose() CEconn.Close() CEconn.Dispose() I had to do this in one of my webservice functions, when we had weird issues: _ Public Function InsertInvHdr(ByVal strInput As String, ByVal dsIn As DataSet) As String Dim errNum As Integer Dim errMsg As String Dim myConnection As SqlConnection Dim myCommand As SqlCommand Dim row As DataRow Call fUnSecureString(strInput) Try 'Following parameters are determined from strInput hash saved as global variables myConnection = New SqlConnection("server=" & ServerName & ";uid=" & strUid & ";pwd=" & strPw& ";database=" & strDBname) myConnection.Open() myCommand = New SqlCommand myCommand.Connection = myConnection For Each row In dsIn.Tables(0).Rows myCommand.CommandText = "EXEC stpInsertIntoInvHdr '" & row("ICNo").ToString() & "', '" & row("StoreNo").ToString() & "', '" & row("CustNo").ToString() myCommand.ExecuteNonQuery() Next Return "InvHdr data inserted" 'myConnection.Close() '****************************************************************** ' Added the 2 IF statements below on 8/4/2010 to see if it clears out sleeping processes If (Not (myCommand) Is Nothing) Then myCommand.Dispose() myCommand = Nothing End If If (Not (myConnection) Is Nothing) Then myConnection.Close() End If '******************************************************** Catch ex As Exception errNum = Err.Number errMsg = ex.Message Return "SQL/WS Error: WS.InsertInvHdr - " & errNum & ":" & errMsg 'Finally ' myConnection.Close() End Try End Function On Wed, Jun 8, 2011 at 8:47 AM, Francisco Tapia wrote: > so I have a vb.net app (visual studio 2008) and I am making some sproc > calls > like so: > > > conn = New SqlConnection(My.MySettings.Default.dbConn) > cmd = New SqlCommand("dbo.stp_PCO", conn) > cmd.CommandType = CommandType.StoredProcedure > conn.Open() > da.SelectCommand = cmd > da.Fill(dtCTable) > > I've also tried closing my connections after usage by using the following > closing statments > > dtCtable.Dispose() > dtClockTable = nothing > cmd.Dispose() > cmd = nothing > da.Dispose() > da = nothing > conn.close() > conn.Dispose() > conn = nothing > > but when I check my sql server I still see sleeping entires in the activity > monitor suggesting that a connection is still active. How do I sever the > connection completely? I know a connection is alive and well because I > noticed that if I completely close the application the connection goes from > sleeping to gone. I want my connections to close once the data has been > retrieved to allow the server to reuse that memory if needed. > > in vb 6 it used to be so simple with just ado :( > > your help is of course appreciated! > > > -Francisco > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Jun 11 09:36:53 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 11 Jun 2011 18:36:53 +0400 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 In-Reply-To: References: Message-ID: Hi Gustav -- That was "miPtySing". I meant .NET Framework's built-in System.TimeSpan struct not TimeStamp (which doesn't exist). I typed my code snippet from memory and my "brainputer"'s memory obviously "got a Glueck" after a heavy duty working day of a large batch of VS2008 projects conversion to VS2010. Correct sample code snippet should have been something like the following: // Define TimeSpan value equal to // 10 hours 11 minutes and 12 seconds TimeSpan ts = new TimeSpan(10, 11, 12); // correct TimeSpan value formatting string s = string.Format("Correct = {0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); // incorrect TimeSpan value formatting try { s = string.Format("Incorrect = {0:hh:mm:ss}", ts); System.Console.WriteLine(s); } catch (Exception ex) { System.Console.WriteLine("Error: {0}", ex.Message); } Thank you. -- Shamil P.S. Sorry for delay with my reply - I've got a short vacation immediately after I have posted to Access-D my original posting... -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ???? 2011 ?. 14:08 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From gustav at cactus.dk Sat Jun 11 17:30:44 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 12 Jun 2011 00:30:44 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil Ha ha, "got a Glueck", that explains! /gustav >>> shamil at smsconsulting.spb.ru 11-06-2011 16:36 >>> Hi Gustav -- That was "miPtySing". I meant .NET Framework's built-in System.TimeSpan struct not TimeStamp (which doesn't exist). I typed my code snippet from memory and my "brainputer"'s memory obviously "got a Glueck" after a heavy duty working day of a large batch of VS2008 projects conversion to VS2010. Correct sample code snippet should have been something like the following: // Define TimeSpan value equal to // 10 hours 11 minutes and 12 seconds TimeSpan ts = new TimeSpan(10, 11, 12); // correct TimeSpan value formatting string s = string.Format("Correct = {0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); // incorrect TimeSpan value formatting try { s = string.Format("Incorrect = {0:hh:mm:ss}", ts); System.Console.WriteLine(s); } catch (Exception ex) { System.Console.WriteLine("Error: {0}", ex.Message); } Thank you. -- Shamil P.S. Sorry for delay with my reply - I've got a short vacation immediately after I have posted to Access-D my original posting... -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ???? 2011 ?. 14:08 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From fhtapia at gmail.com Mon Jun 13 14:37:38 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 13 Jun 2011 12:37:38 -0700 Subject: [dba-VB] closing your connections In-Reply-To: References: Message-ID: I'm not sure, I am closing and disposing my objects as I posted in my first post... but if I monitor the sql server I notice that the connection is still active.(in awaiting sleep status but connected) :-/ -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Wed, Jun 8, 2011 at 10:22 AM, David McAfee wrote: > This is what I do with SQLCE when I need to modify the SDF, which shouldn't > differ too much from SQL Server: > > Dim strCEconn As String = "Data Source = " & strPath & strFileName > Dim CEconn As SqlServerCe.SqlCeConnection = New > SqlServerCe.SqlCeConnection(strCEconn) > CEconn.Open() > Dim CEcmd As SqlServerCe.SqlCeCommand = CEconn.CreateCommand > > CEcmd.CommandText = "CREATE TABLE InvoiceOrderJunct([InvNo] > [nvarchar](8) NULL, [OrderID] [int], [AMNo] [nvarchar](10) NULL)" > CEcmd.ExecuteNonQuery() > > CEcmd.Dispose() > CEconn.Close() > CEconn.Dispose() > > > I had to do this in one of my webservice functions, when we had weird > issues: > > > _ > Public Function InsertInvHdr(ByVal strInput As String, ByVal dsIn As > DataSet) As String > > Dim errNum As Integer > Dim errMsg As String > Dim myConnection As SqlConnection > Dim myCommand As SqlCommand > Dim row As DataRow > > Call fUnSecureString(strInput) > > Try > 'Following parameters are determined from strInput hash saved as > global variables > myConnection = New SqlConnection("server=" & ServerName & > ";uid=" & strUid & ";pwd=" & strPw& ";database=" & strDBname) > myConnection.Open() > myCommand = New SqlCommand > myCommand.Connection = myConnection > > For Each row In dsIn.Tables(0).Rows > myCommand.CommandText = "EXEC stpInsertIntoInvHdr '" & > row("ICNo").ToString() & "', '" & row("StoreNo").ToString() & "', '" & > row("CustNo").ToString() > myCommand.ExecuteNonQuery() > Next > > Return "InvHdr data inserted" > 'myConnection.Close() > > '****************************************************************** > ' Added the 2 IF statements below on 8/4/2010 to see if it > clears out sleeping processes > If (Not (myCommand) Is Nothing) Then > myCommand.Dispose() > myCommand = Nothing > End If > If (Not (myConnection) Is Nothing) Then > myConnection.Close() > End If > '******************************************************** > Catch ex As Exception > errNum = Err.Number > errMsg = ex.Message > Return "SQL/WS Error: WS.InsertInvHdr - " & errNum & ":" & > errMsg > 'Finally > ' myConnection.Close() > End Try > End Function > > > > On Wed, Jun 8, 2011 at 8:47 AM, Francisco Tapia wrote: > > > so I have a vb.net app (visual studio 2008) and I am making some sproc > > calls > > like so: > > > > > > conn = New SqlConnection(My.MySettings.Default.dbConn) > > cmd = New SqlCommand("dbo.stp_PCO", conn) > > cmd.CommandType = CommandType.StoredProcedure > > conn.Open() > > da.SelectCommand = cmd > > da.Fill(dtCTable) > > > > I've also tried closing my connections after usage by using the following > > closing statments > > > > dtCtable.Dispose() > > dtClockTable = nothing > > cmd.Dispose() > > cmd = nothing > > da.Dispose() > > da = nothing > > conn.close() > > conn.Dispose() > > conn = nothing > > > > but when I check my sql server I still see sleeping entires in the > activity > > monitor suggesting that a connection is still active. How do I sever the > > connection completely? I know a connection is alive and well because I > > noticed that if I completely close the application the connection goes > from > > sleeping to gone. I want my connections to close once the data has been > > retrieved to allow the server to reuse that memory if needed. > > > > in vb 6 it used to be so simple with just ado :( > > > > your help is of course appreciated! > > > > > > -Francisco > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jun 14 15:06:10 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 14 Jun 2011 16:06:10 -0400 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 Message-ID: <4DF7BF32.1090405@colbyconsulting.com> It has finally arrived! -- John W. Colby www.ColbyConsulting.com http://techreport.com/articles.x/16255 From fhtapia at gmail.com Thu Jun 16 10:58:04 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 16 Jun 2011 08:58:04 -0700 Subject: [dba-VB] A windows Service or Not a service? Message-ID: I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stationsand Desktopsin the Platform SDK documentation. -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) From jwcolby at colbyconsulting.com Thu Jun 16 11:32:25 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Jun 2011 12:32:25 -0400 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: <4DFA3019.7020109@colbyconsulting.com> I too need to know this. A service cannot directly support a user interface because if there is no one logged in there is no place to put the user interface (no screen to draw it). My guess is that the user interface somehow calls functions to get information, or perhaps hooks a data "service" channel to read / write to the service application. John W. Colby www.ColbyConsulting.com On 6/16/2011 11:58 AM, Francisco Tapia wrote: > I wrote a simple application that has a form and two buttons (along with a > timer). My initial idea was that I would write this to be a windows service > so it would auto-start whenever a specific server would reboot etc. The > purpose is that I need to get new records created by a "Vendor" application > and have them sent to a Second "Vendor" system. I call a custom view that I > wrote that collects that last set of changes, then record by record calls a > webservice on our SAP system and pushes in the new changes. My sql server > version is Sql Server 2000 so it's not as easy as just writing a soap object > to make the webservice call, I think it was much easier to just write the > app in c# and make the call that way, which works. NOW for the tricky > part. I wanted to write up the app to create a windows service installer so > that my admins could log into the windows server and either start or stop > the application, I also wanted to provide a gui view to the windows service > so that they could choose a different timer so it could run every 1 minute > (every 2 minutes, etc..) what ever they would choose. > > after reading MS's description on windows service classes, I noticed that > supposedly the .Net Studio does not support this, but I've seen other apps > that DO provide a gui view to the windows service that they introduce. so > my question to the group is, have you done this before? and if so how did > you go about it? > > -- > http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx > > The Windows service classes supported by the .NET Framework do not support > interaction with interactive stations, that is, the logged-on user. The .NET > Framework also does not include classes that represent stations and > desktops. If your Windows service must interact with other stations, you > will need to access the unmanaged Windows API. For more information, see Window > Stationsand > Desktopsin > the Platform SDK documentation. > > > -Francisco > http://bit.ly/sqlthis | Tsql and More... > http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From fhtapia at gmail.com Thu Jun 16 11:35:09 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 16 Jun 2011 09:35:09 -0700 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: <4DFA3019.7020109@colbyconsulting.com> References: <4DFA3019.7020109@colbyconsulting.com> Message-ID: I'm wondering about that too, does that mean that I need to package "2" applications? one service with a port that will talk to the gui so that a user can modify a specific setting (namely, how often it checks for new records). -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Thu, Jun 16, 2011 at 9:32 AM, jwcolby wrote: > I too need to know this. A service cannot directly support a user > interface because if there is no one logged in there is no place to put the > user interface (no screen to draw it). My guess is that the user interface > somehow calls functions to get information, or perhaps hooks a data > "service" channel to read / write to the service application. > > John W. Colby > www.ColbyConsulting.com > > > On 6/16/2011 11:58 AM, Francisco Tapia wrote: > >> I wrote a simple application that has a form and two buttons (along with a >> timer). My initial idea was that I would write this to be a windows >> service >> so it would auto-start whenever a specific server would reboot etc. The >> purpose is that I need to get new records created by a "Vendor" >> application >> and have them sent to a Second "Vendor" system. I call a custom view that >> I >> wrote that collects that last set of changes, then record by record calls >> a >> webservice on our SAP system and pushes in the new changes. My sql server >> version is Sql Server 2000 so it's not as easy as just writing a soap >> object >> to make the webservice call, I think it was much easier to just write the >> app in c# and make the call that way, which works. NOW for the tricky >> part. I wanted to write up the app to create a windows service installer >> so >> that my admins could log into the windows server and either start or stop >> the application, I also wanted to provide a gui view to the windows >> service >> so that they could choose a different timer so it could run every 1 minute >> (every 2 minutes, etc..) what ever they would choose. >> >> after reading MS's description on windows service classes, I noticed that >> supposedly the .Net Studio does not support this, but I've seen other apps >> that DO provide a gui view to the windows service that they introduce. so >> my question to the group is, have you done this before? and if so how did >> you go about it? >> >> -- >> http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx >> >> The Windows service classes supported by the .NET Framework do not support >> interaction with interactive stations, that is, the logged-on user. The >> .NET >> Framework also does not include classes that represent stations and >> desktops. If your Windows service must interact with other stations, you >> will need to access the unmanaged Windows API. For more information, see >> Window >> Stations< >> http://msdn.microsoft.com/en-us/library/ms687096%28v=VS.90%29.aspx>and >> Desktops< >> http://msdn.microsoft.com/en-us/library/ms682573%28v=VS.90%29.aspx>in >> >> the Platform SDK documentation. >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> >> _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From dw-murphy at cox.net Thu Jun 16 12:38:47 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 16 Jun 2011 10:38:47 -0700 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: <4DFA3019.7020109@colbyconsulting.com> Message-ID: <009601cc2c4c$3f663020$be329060$@cox.net> How about having a little config file that goes along with the service that you could edit in notepad or xml note pad since .NET loves xml files. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, June 16, 2011 9:35 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] A windows Service or Not a service? I'm wondering about that too, does that mean that I need to package "2" applications? one service with a port that will talk to the gui so that a user can modify a specific setting (namely, how often it checks for new records). -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Thu, Jun 16, 2011 at 9:32 AM, jwcolby wrote: > I too need to know this. A service cannot directly support a user > interface because if there is no one logged in there is no place to > put the user interface (no screen to draw it). My guess is that the > user interface somehow calls functions to get information, or perhaps > hooks a data "service" channel to read / write to the service application. > > John W. Colby > www.ColbyConsulting.com > > > On 6/16/2011 11:58 AM, Francisco Tapia wrote: > >> I wrote a simple application that has a form and two buttons (along >> with a timer). My initial idea was that I would write this to be a >> windows service so it would auto-start whenever a specific server >> would reboot etc. The purpose is that I need to get new records >> created by a "Vendor" >> application >> and have them sent to a Second "Vendor" system. I call a custom view >> that I wrote that collects that last set of changes, then record by >> record calls a webservice on our SAP system and pushes in the new >> changes. My sql server version is Sql Server 2000 so it's not as >> easy as just writing a soap object to make the webservice call, I >> think it was much easier to just write the app in c# and make the >> call that way, which works. NOW for the tricky part. I wanted to >> write up the app to create a windows service installer so that my >> admins could log into the windows server and either start or stop the >> application, I also wanted to provide a gui view to the windows >> service so that they could choose a different timer so it could run >> every 1 minute (every 2 minutes, etc..) what ever they would choose. >> >> after reading MS's description on windows service classes, I noticed >> that supposedly the .Net Studio does not support this, but I've seen >> other apps that DO provide a gui view to the windows service that >> they introduce. so my question to the group is, have you done this >> before? and if so how did you go about it? >> >> -- >> http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx >> >> The Windows service classes supported by the .NET Framework do not >> support interaction with interactive stations, that is, the logged-on >> user. The .NET Framework also does not include classes that represent >> stations and desktops. If your Windows service must interact with >> other stations, you will need to access the unmanaged Windows API. >> For more information, see Window Stations< >> http://msdn.microsoft.com/en-us/library/ms687096%28v=VS.90%29.aspx>an >> d >> Desktops< >> http://msdn.microsoft.com/en-us/library/ms682573%28v=VS.90%29.aspx>in >> >> the Platform SDK documentation. >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> >> _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 16 12:50:06 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 16 Jun 2011 21:50:06 +0400 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: <0466803437EC465DB77794C395A63253@nant> Hi Francisco, I have written a few real life WinServices working 24x7x365 for a few years. When a Windows Service Project is created its base class has code snippet as the following: public partial class MyService : ServiceBase { ... protected override void OnCustomCommand(int command) { switch(command) { case 503: CustomCommand503(); return; ... } } } It allows to define as many custom commands as you wanted to have. You comunicate with a Windows Service using that custom commands' IDs - here is a code snippet showing how to find your installed and runing Windows Service and to pass to it your custom command ID: public static void RunCustomServiceCommand(string serviceName, int commandId) { foreach (System.ServiceProcess.ServiceController service in System.ServiceProcess.ServiceController.GetServices()) { // juts a test output - commented it when not needed System.Console.WriteLine("[{0}].[{1}].[{2}]", service.MachineName, service.ServiceName, service.DisplayName); if (string.Compare(service.ServiceName, serviceName, true) == 0) { service.ExecuteCommand(commandId); } } } When I need to pass to a Windows Service more parameters than command id then I use inderect/intermediate media: files, database tables, ... Another issue is to smoothly install, run, stop, uninstall a Windows service - there should be more info on Internet and MSDN about that issues... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: 16 ???? 2011 ?. 19:58 To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] A windows Service or Not a service? I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stations and Desktops in the Platform SDK documentation. -Francisco From DWUTKA at Marlow.com Thu Jun 16 17:08:46 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 16 Jun 2011 17:08:46 -0500 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: An NT Service (as you are calling it a Windows Service) is an executable that is running on your machine and it has several different 'properties'. First, the type of startup... either manual, disabled or automatic. Automatic starts when you computer starts. Disabled means the service won't start. Secondly, there is an 'interactive' option, that determines if a service can run with an interface. For this to work, it has to have user credentials. Services with a user interface can run into all sorts of issues. I personally haven't built a service in .net yet, but have had lots of experience with them in VB 6. What you really want to do is build a service that has no interface, and then build a program that 'controls' that program. This can be done in many ways, either you can have the control change values in a database or file, that the service utilizes, or you can create various 'talking' methods, like named pipes, tcp/ip comms, etc, that allows the controlling program to directly talk to the service. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, June 16, 2011 10:58 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] A windows Service or Not a service? I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stationsand Desktopsin the Platform SDK documentation. -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From john at winhaven.net Mon Jun 20 14:02:12 2011 From: john at winhaven.net (John Bartow) Date: Mon, 20 Jun 2011 14:02:12 -0500 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <4DF7BF32.1090405@colbyconsulting.com> References: <4DF7BF32.1090405@colbyconsulting.com> Message-ID: <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> JC, Have you put in your order yet? http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% 20Solid%20State%20Drive&idno_no=270 John B -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, June 14, 2011 3:06 PM To: Access Developers discussion and problem solving; VBA; Sqlserver-Dba Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 It has finally arrived! http://techreport.com/articles.x/16255 From jwcolby at colbyconsulting.com Mon Jun 20 14:06:57 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Jun 2011 15:06:57 -0400 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> References: <4DF7BF32.1090405@colbyconsulting.com> <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> Message-ID: <4DFF9A51.60503@colbyconsulting.com> Nope, too much money for me. If they would do it for $199 I would have it on order already. John W. Colby www.ColbyConsulting.com On 6/20/2011 3:02 PM, John Bartow wrote: > http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% > 20Solid%20State%20Drive&idno_no=270 > From john at winhaven.net Mon Jun 20 14:17:41 2011 From: john at winhaven.net (John Bartow) Date: Mon, 20 Jun 2011 14:17:41 -0500 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <4DFF9A51.60503@colbyconsulting.com> References: <4DF7BF32.1090405@colbyconsulting.com> <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> <4DFF9A51.60503@colbyconsulting.com> Message-ID: <002701cc2f7e$b9cb6080$2d622180$@winhaven.net> LOL! Give it a couple of months. It'll be on clearance at Fry's. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, June 20, 2011 2:07 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 Nope, too much money for me. If they would do it for $199 I would have it on order already. John W. Colby www.ColbyConsulting.com On 6/20/2011 3:02 PM, John Bartow wrote: > http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% > 20Solid%20State%20Drive&idno_no=270 > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Sun Jun 5 15:12:43 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Mon, 6 Jun 2011 00:12:43 +0400 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: <91E8E248DC5845CBA678F51B568217E5@nant> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From Gustav at cactus.dk Mon Jun 6 04:41:52 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 11:41:52 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil So what you try to tell ... is that a colon on its own now is reserved for the use as the separator between the value and the format string? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From stuart at lexacorp.com.pg Mon Jun 6 04:57:15 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 06 Jun 2011 19:57:15 +1000 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 In-Reply-To: References: Message-ID: <4DECA47B.29763.1FEC6F0@stuart.lexacorp.com.pg> Not just the colon, any separator: The custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, "dd\.hh\:mm" defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours and minutes. -- Stuart On 6 Jun 2011 at 11:41, Gustav Brock wrote: > Hi Shamil > > So what you try to tell ... is that a colon on its own now is reserved > for the use as the separator between the value and the format string? > > /gustav > > > >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> > Hi All -- > > FYI: I have got used to format TimeStamp values this simple way (for > TimeStamp values less than a day): > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh:mm:ss}", ts); > System.Console.WriteLine(s); > > and it worked well for VS2008/.NET 3.5 but when my project was > converted to VS2010SP1/.NET 4.0 I have got runtime error... > > Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh\\:mm\\:ss}", ts); > System.Console.WriteLine(s); > > Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx > > Thank you. > > -- > Shamil > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From Gustav at cactus.dk Mon Jun 6 05:07:46 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 12:07:46 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From Gustav at cactus.dk Mon Jun 6 06:07:05 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 06 Jun 2011 13:07:05 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Stuart Well, yes for the format string, but "any" separator is not (can not) be used to separate the value and the format string; it has to be a colon: string s = string.Format("{0:hh\\:mm\\:ss}", ts); /gustav >>> "Stuart McLachlan" 06-06-2011 11:57 >>> Not just the colon, any separator: The custom TimeSpan format specifiers do not include placeholder separator symbols, such as the symbols that separate days from hours, hours from minutes, or seconds from fractional seconds. Instead, these symbols must be included in the custom format string as string literals. For example, "dd\.hh\:mm" defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours and minutes. -- Stuart On 6 Jun 2011 at 11:41, Gustav Brock wrote: > Hi Shamil > > So what you try to tell ... is that a colon on its own now is reserved > for the use as the separator between the value and the format string? > > /gustav > > > >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> > Hi All -- > > FYI: I have got used to format TimeStamp values this simple way (for > TimeStamp values less than a day): > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh:mm:ss}", ts); > System.Console.WriteLine(s); > > and it worked well for VS2008/.NET 3.5 but when my project was > converted to VS2010SP1/.NET 4.0 I have got runtime error... > > Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : > > TimeStamp ts = new TimeStamp(10,11,12); > string s = string.Format("{0:hh\\:mm\\:ss}", ts); > System.Console.WriteLine(s); > > Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx > > Thank you. > > -- > Shamil From fhtapia at gmail.com Wed Jun 8 10:47:35 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 8 Jun 2011 08:47:35 -0700 Subject: [dba-VB] closing your connections Message-ID: so I have a vb.net app (visual studio 2008) and I am making some sproc calls like so: conn = New SqlConnection(My.MySettings.Default.dbConn) cmd = New SqlCommand("dbo.stp_PCO", conn) cmd.CommandType = CommandType.StoredProcedure conn.Open() da.SelectCommand = cmd da.Fill(dtCTable) I've also tried closing my connections after usage by using the following closing statments dtCtable.Dispose() dtClockTable = nothing cmd.Dispose() cmd = nothing da.Dispose() da = nothing conn.close() conn.Dispose() conn = nothing but when I check my sql server I still see sleeping entires in the activity monitor suggesting that a connection is still active. How do I sever the connection completely? I know a connection is alive and well because I noticed that if I completely close the application the connection goes from sleeping to gone. I want my connections to close once the data has been retrieved to allow the server to reuse that memory if needed. in vb 6 it used to be so simple with just ado :( your help is of course appreciated! -Francisco From davidmcafee at gmail.com Wed Jun 8 12:22:21 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 8 Jun 2011 10:22:21 -0700 Subject: [dba-VB] closing your connections In-Reply-To: References: Message-ID: This is what I do with SQLCE when I need to modify the SDF, which shouldn't differ too much from SQL Server: Dim strCEconn As String = "Data Source = " & strPath & strFileName Dim CEconn As SqlServerCe.SqlCeConnection = New SqlServerCe.SqlCeConnection(strCEconn) CEconn.Open() Dim CEcmd As SqlServerCe.SqlCeCommand = CEconn.CreateCommand CEcmd.CommandText = "CREATE TABLE InvoiceOrderJunct([InvNo] [nvarchar](8) NULL, [OrderID] [int], [AMNo] [nvarchar](10) NULL)" CEcmd.ExecuteNonQuery() CEcmd.Dispose() CEconn.Close() CEconn.Dispose() I had to do this in one of my webservice functions, when we had weird issues: _ Public Function InsertInvHdr(ByVal strInput As String, ByVal dsIn As DataSet) As String Dim errNum As Integer Dim errMsg As String Dim myConnection As SqlConnection Dim myCommand As SqlCommand Dim row As DataRow Call fUnSecureString(strInput) Try 'Following parameters are determined from strInput hash saved as global variables myConnection = New SqlConnection("server=" & ServerName & ";uid=" & strUid & ";pwd=" & strPw& ";database=" & strDBname) myConnection.Open() myCommand = New SqlCommand myCommand.Connection = myConnection For Each row In dsIn.Tables(0).Rows myCommand.CommandText = "EXEC stpInsertIntoInvHdr '" & row("ICNo").ToString() & "', '" & row("StoreNo").ToString() & "', '" & row("CustNo").ToString() myCommand.ExecuteNonQuery() Next Return "InvHdr data inserted" 'myConnection.Close() '****************************************************************** ' Added the 2 IF statements below on 8/4/2010 to see if it clears out sleeping processes If (Not (myCommand) Is Nothing) Then myCommand.Dispose() myCommand = Nothing End If If (Not (myConnection) Is Nothing) Then myConnection.Close() End If '******************************************************** Catch ex As Exception errNum = Err.Number errMsg = ex.Message Return "SQL/WS Error: WS.InsertInvHdr - " & errNum & ":" & errMsg 'Finally ' myConnection.Close() End Try End Function On Wed, Jun 8, 2011 at 8:47 AM, Francisco Tapia wrote: > so I have a vb.net app (visual studio 2008) and I am making some sproc > calls > like so: > > > conn = New SqlConnection(My.MySettings.Default.dbConn) > cmd = New SqlCommand("dbo.stp_PCO", conn) > cmd.CommandType = CommandType.StoredProcedure > conn.Open() > da.SelectCommand = cmd > da.Fill(dtCTable) > > I've also tried closing my connections after usage by using the following > closing statments > > dtCtable.Dispose() > dtClockTable = nothing > cmd.Dispose() > cmd = nothing > da.Dispose() > da = nothing > conn.close() > conn.Dispose() > conn = nothing > > but when I check my sql server I still see sleeping entires in the activity > monitor suggesting that a connection is still active. How do I sever the > connection completely? I know a connection is alive and well because I > noticed that if I completely close the application the connection goes from > sleeping to gone. I want my connections to close once the data has been > retrieved to allow the server to reuse that memory if needed. > > in vb 6 it used to be so simple with just ado :( > > your help is of course appreciated! > > > -Francisco > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From shamil at smsconsulting.spb.ru Sat Jun 11 09:36:53 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sat, 11 Jun 2011 18:36:53 +0400 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 In-Reply-To: References: Message-ID: Hi Gustav -- That was "miPtySing". I meant .NET Framework's built-in System.TimeSpan struct not TimeStamp (which doesn't exist). I typed my code snippet from memory and my "brainputer"'s memory obviously "got a Glueck" after a heavy duty working day of a large batch of VS2008 projects conversion to VS2010. Correct sample code snippet should have been something like the following: // Define TimeSpan value equal to // 10 hours 11 minutes and 12 seconds TimeSpan ts = new TimeSpan(10, 11, 12); // correct TimeSpan value formatting string s = string.Format("Correct = {0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); // incorrect TimeSpan value formatting try { s = string.Format("Incorrect = {0:hh:mm:ss}", ts); System.Console.WriteLine(s); } catch (Exception ex) { System.Console.WriteLine("Error: {0}", ex.Message); } Thank you. -- Shamil P.S. Sorry for delay with my reply - I've got a short vacation immediately after I have posted to Access-D my original posting... -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ???? 2011 ?. 14:08 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From gustav at cactus.dk Sat Jun 11 17:30:44 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 12 Jun 2011 00:30:44 +0200 Subject: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Message-ID: Hi Shamil Ha ha, "got a Glueck", that explains! /gustav >>> shamil at smsconsulting.spb.ru 11-06-2011 16:36 >>> Hi Gustav -- That was "miPtySing". I meant .NET Framework's built-in System.TimeSpan struct not TimeStamp (which doesn't exist). I typed my code snippet from memory and my "brainputer"'s memory obviously "got a Glueck" after a heavy duty working day of a large batch of VS2008 projects conversion to VS2010. Correct sample code snippet should have been something like the following: // Define TimeSpan value equal to // 10 hours 11 minutes and 12 seconds TimeSpan ts = new TimeSpan(10, 11, 12); // correct TimeSpan value formatting string s = string.Format("Correct = {0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); // incorrect TimeSpan value formatting try { s = string.Format("Incorrect = {0:hh:mm:ss}", ts); System.Console.WriteLine(s); } catch (Exception ex) { System.Console.WriteLine("Error: {0}", ex.Message); } Thank you. -- Shamil P.S. Sorry for delay with my reply - I've got a short vacation immediately after I have posted to Access-D my original posting... -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 6 ???? 2011 ?. 14:08 To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0 Hi Shamil By the way, where does "TimeSpan" come from? Is it native to C# or custom by you? /gustav >>> shamil at smsconsulting.spb.ru 05-06-2011 22:12 >>> Hi All -- FYI: I have got used to format TimeStamp values this simple way (for TimeStamp values less than a day): TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh:mm:ss}", ts); System.Console.WriteLine(s); and it worked well for VS2008/.NET 3.5 but when my project was converted to VS2010SP1/.NET 4.0 I have got runtime error... Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} : TimeStamp ts = new TimeStamp(10,11,12); string s = string.Format("{0:hh\\:mm\\:ss}", ts); System.Console.WriteLine(s); Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx Thank you. -- Shamil From fhtapia at gmail.com Mon Jun 13 14:37:38 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Mon, 13 Jun 2011 12:37:38 -0700 Subject: [dba-VB] closing your connections In-Reply-To: References: Message-ID: I'm not sure, I am closing and disposing my objects as I posted in my first post... but if I monitor the sql server I notice that the connection is still active.(in awaiting sleep status but connected) :-/ -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Wed, Jun 8, 2011 at 10:22 AM, David McAfee wrote: > This is what I do with SQLCE when I need to modify the SDF, which shouldn't > differ too much from SQL Server: > > Dim strCEconn As String = "Data Source = " & strPath & strFileName > Dim CEconn As SqlServerCe.SqlCeConnection = New > SqlServerCe.SqlCeConnection(strCEconn) > CEconn.Open() > Dim CEcmd As SqlServerCe.SqlCeCommand = CEconn.CreateCommand > > CEcmd.CommandText = "CREATE TABLE InvoiceOrderJunct([InvNo] > [nvarchar](8) NULL, [OrderID] [int], [AMNo] [nvarchar](10) NULL)" > CEcmd.ExecuteNonQuery() > > CEcmd.Dispose() > CEconn.Close() > CEconn.Dispose() > > > I had to do this in one of my webservice functions, when we had weird > issues: > > > _ > Public Function InsertInvHdr(ByVal strInput As String, ByVal dsIn As > DataSet) As String > > Dim errNum As Integer > Dim errMsg As String > Dim myConnection As SqlConnection > Dim myCommand As SqlCommand > Dim row As DataRow > > Call fUnSecureString(strInput) > > Try > 'Following parameters are determined from strInput hash saved as > global variables > myConnection = New SqlConnection("server=" & ServerName & > ";uid=" & strUid & ";pwd=" & strPw& ";database=" & strDBname) > myConnection.Open() > myCommand = New SqlCommand > myCommand.Connection = myConnection > > For Each row In dsIn.Tables(0).Rows > myCommand.CommandText = "EXEC stpInsertIntoInvHdr '" & > row("ICNo").ToString() & "', '" & row("StoreNo").ToString() & "', '" & > row("CustNo").ToString() > myCommand.ExecuteNonQuery() > Next > > Return "InvHdr data inserted" > 'myConnection.Close() > > '****************************************************************** > ' Added the 2 IF statements below on 8/4/2010 to see if it > clears out sleeping processes > If (Not (myCommand) Is Nothing) Then > myCommand.Dispose() > myCommand = Nothing > End If > If (Not (myConnection) Is Nothing) Then > myConnection.Close() > End If > '******************************************************** > Catch ex As Exception > errNum = Err.Number > errMsg = ex.Message > Return "SQL/WS Error: WS.InsertInvHdr - " & errNum & ":" & > errMsg > 'Finally > ' myConnection.Close() > End Try > End Function > > > > On Wed, Jun 8, 2011 at 8:47 AM, Francisco Tapia wrote: > > > so I have a vb.net app (visual studio 2008) and I am making some sproc > > calls > > like so: > > > > > > conn = New SqlConnection(My.MySettings.Default.dbConn) > > cmd = New SqlCommand("dbo.stp_PCO", conn) > > cmd.CommandType = CommandType.StoredProcedure > > conn.Open() > > da.SelectCommand = cmd > > da.Fill(dtCTable) > > > > I've also tried closing my connections after usage by using the following > > closing statments > > > > dtCtable.Dispose() > > dtClockTable = nothing > > cmd.Dispose() > > cmd = nothing > > da.Dispose() > > da = nothing > > conn.close() > > conn.Dispose() > > conn = nothing > > > > but when I check my sql server I still see sleeping entires in the > activity > > monitor suggesting that a connection is still active. How do I sever the > > connection completely? I know a connection is alive and well because I > > noticed that if I completely close the application the connection goes > from > > sleeping to gone. I want my connections to close once the data has been > > retrieved to allow the server to reuse that memory if needed. > > > > in vb 6 it used to be so simple with just ado :( > > > > your help is of course appreciated! > > > > > > -Francisco > > _______________________________________________ > > dba-VB mailing list > > dba-VB at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-vb > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Tue Jun 14 15:06:10 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 14 Jun 2011 16:06:10 -0400 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 Message-ID: <4DF7BF32.1090405@colbyconsulting.com> It has finally arrived! -- John W. Colby www.ColbyConsulting.com http://techreport.com/articles.x/16255 From fhtapia at gmail.com Thu Jun 16 10:58:04 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 16 Jun 2011 08:58:04 -0700 Subject: [dba-VB] A windows Service or Not a service? Message-ID: I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stationsand Desktopsin the Platform SDK documentation. -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) From jwcolby at colbyconsulting.com Thu Jun 16 11:32:25 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 16 Jun 2011 12:32:25 -0400 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: <4DFA3019.7020109@colbyconsulting.com> I too need to know this. A service cannot directly support a user interface because if there is no one logged in there is no place to put the user interface (no screen to draw it). My guess is that the user interface somehow calls functions to get information, or perhaps hooks a data "service" channel to read / write to the service application. John W. Colby www.ColbyConsulting.com On 6/16/2011 11:58 AM, Francisco Tapia wrote: > I wrote a simple application that has a form and two buttons (along with a > timer). My initial idea was that I would write this to be a windows service > so it would auto-start whenever a specific server would reboot etc. The > purpose is that I need to get new records created by a "Vendor" application > and have them sent to a Second "Vendor" system. I call a custom view that I > wrote that collects that last set of changes, then record by record calls a > webservice on our SAP system and pushes in the new changes. My sql server > version is Sql Server 2000 so it's not as easy as just writing a soap object > to make the webservice call, I think it was much easier to just write the > app in c# and make the call that way, which works. NOW for the tricky > part. I wanted to write up the app to create a windows service installer so > that my admins could log into the windows server and either start or stop > the application, I also wanted to provide a gui view to the windows service > so that they could choose a different timer so it could run every 1 minute > (every 2 minutes, etc..) what ever they would choose. > > after reading MS's description on windows service classes, I noticed that > supposedly the .Net Studio does not support this, but I've seen other apps > that DO provide a gui view to the windows service that they introduce. so > my question to the group is, have you done this before? and if so how did > you go about it? > > -- > http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx > > The Windows service classes supported by the .NET Framework do not support > interaction with interactive stations, that is, the logged-on user. The .NET > Framework also does not include classes that represent stations and > desktops. If your Windows service must interact with other stations, you > will need to access the unmanaged Windows API. For more information, see Window > Stationsand > Desktopsin > the Platform SDK documentation. > > > -Francisco > http://bit.ly/sqlthis | Tsql and More... > http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From fhtapia at gmail.com Thu Jun 16 11:35:09 2011 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 16 Jun 2011 09:35:09 -0700 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: <4DFA3019.7020109@colbyconsulting.com> References: <4DFA3019.7020109@colbyconsulting.com> Message-ID: I'm wondering about that too, does that mean that I need to package "2" applications? one service with a port that will talk to the gui so that a user can modify a specific setting (namely, how often it checks for new records). -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Thu, Jun 16, 2011 at 9:32 AM, jwcolby wrote: > I too need to know this. A service cannot directly support a user > interface because if there is no one logged in there is no place to put the > user interface (no screen to draw it). My guess is that the user interface > somehow calls functions to get information, or perhaps hooks a data > "service" channel to read / write to the service application. > > John W. Colby > www.ColbyConsulting.com > > > On 6/16/2011 11:58 AM, Francisco Tapia wrote: > >> I wrote a simple application that has a form and two buttons (along with a >> timer). My initial idea was that I would write this to be a windows >> service >> so it would auto-start whenever a specific server would reboot etc. The >> purpose is that I need to get new records created by a "Vendor" >> application >> and have them sent to a Second "Vendor" system. I call a custom view that >> I >> wrote that collects that last set of changes, then record by record calls >> a >> webservice on our SAP system and pushes in the new changes. My sql server >> version is Sql Server 2000 so it's not as easy as just writing a soap >> object >> to make the webservice call, I think it was much easier to just write the >> app in c# and make the call that way, which works. NOW for the tricky >> part. I wanted to write up the app to create a windows service installer >> so >> that my admins could log into the windows server and either start or stop >> the application, I also wanted to provide a gui view to the windows >> service >> so that they could choose a different timer so it could run every 1 minute >> (every 2 minutes, etc..) what ever they would choose. >> >> after reading MS's description on windows service classes, I noticed that >> supposedly the .Net Studio does not support this, but I've seen other apps >> that DO provide a gui view to the windows service that they introduce. so >> my question to the group is, have you done this before? and if so how did >> you go about it? >> >> -- >> http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx >> >> The Windows service classes supported by the .NET Framework do not support >> interaction with interactive stations, that is, the logged-on user. The >> .NET >> Framework also does not include classes that represent stations and >> desktops. If your Windows service must interact with other stations, you >> will need to access the unmanaged Windows API. For more information, see >> Window >> Stations< >> http://msdn.microsoft.com/en-us/library/ms687096%28v=VS.90%29.aspx>and >> Desktops< >> http://msdn.microsoft.com/en-us/library/ms682573%28v=VS.90%29.aspx>in >> >> the Platform SDK documentation. >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> >> _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From dw-murphy at cox.net Thu Jun 16 12:38:47 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Thu, 16 Jun 2011 10:38:47 -0700 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: <4DFA3019.7020109@colbyconsulting.com> Message-ID: <009601cc2c4c$3f663020$be329060$@cox.net> How about having a little config file that goes along with the service that you could edit in notepad or xml note pad since .NET loves xml files. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, June 16, 2011 9:35 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] A windows Service or Not a service? I'm wondering about that too, does that mean that I need to package "2" applications? one service with a port that will talk to the gui so that a user can modify a specific setting (namely, how often it checks for new records). -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) On Thu, Jun 16, 2011 at 9:32 AM, jwcolby wrote: > I too need to know this. A service cannot directly support a user > interface because if there is no one logged in there is no place to > put the user interface (no screen to draw it). My guess is that the > user interface somehow calls functions to get information, or perhaps > hooks a data "service" channel to read / write to the service application. > > John W. Colby > www.ColbyConsulting.com > > > On 6/16/2011 11:58 AM, Francisco Tapia wrote: > >> I wrote a simple application that has a form and two buttons (along >> with a timer). My initial idea was that I would write this to be a >> windows service so it would auto-start whenever a specific server >> would reboot etc. The purpose is that I need to get new records >> created by a "Vendor" >> application >> and have them sent to a Second "Vendor" system. I call a custom view >> that I wrote that collects that last set of changes, then record by >> record calls a webservice on our SAP system and pushes in the new >> changes. My sql server version is Sql Server 2000 so it's not as >> easy as just writing a soap object to make the webservice call, I >> think it was much easier to just write the app in c# and make the >> call that way, which works. NOW for the tricky part. I wanted to >> write up the app to create a windows service installer so that my >> admins could log into the windows server and either start or stop the >> application, I also wanted to provide a gui view to the windows >> service so that they could choose a different timer so it could run >> every 1 minute (every 2 minutes, etc..) what ever they would choose. >> >> after reading MS's description on windows service classes, I noticed >> that supposedly the .Net Studio does not support this, but I've seen >> other apps that DO provide a gui view to the windows service that >> they introduce. so my question to the group is, have you done this >> before? and if so how did you go about it? >> >> -- >> http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx >> >> The Windows service classes supported by the .NET Framework do not >> support interaction with interactive stations, that is, the logged-on >> user. The .NET Framework also does not include classes that represent >> stations and desktops. If your Windows service must interact with >> other stations, you will need to access the unmanaged Windows API. >> For more information, see Window Stations< >> http://msdn.microsoft.com/en-us/library/ms687096%28v=VS.90%29.aspx>an >> d >> Desktops< >> http://msdn.microsoft.com/en-us/library/ms682573%28v=VS.90%29.aspx>in >> >> the Platform SDK documentation. >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) >> _______________________________________________ >> dba-VB mailing list >> dba-VB at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-vb >> http://www.databaseadvisors.com >> >> >> _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 16 12:50:06 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 16 Jun 2011 21:50:06 +0400 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: <0466803437EC465DB77794C395A63253@nant> Hi Francisco, I have written a few real life WinServices working 24x7x365 for a few years. When a Windows Service Project is created its base class has code snippet as the following: public partial class MyService : ServiceBase { ... protected override void OnCustomCommand(int command) { switch(command) { case 503: CustomCommand503(); return; ... } } } It allows to define as many custom commands as you wanted to have. You comunicate with a Windows Service using that custom commands' IDs - here is a code snippet showing how to find your installed and runing Windows Service and to pass to it your custom command ID: public static void RunCustomServiceCommand(string serviceName, int commandId) { foreach (System.ServiceProcess.ServiceController service in System.ServiceProcess.ServiceController.GetServices()) { // juts a test output - commented it when not needed System.Console.WriteLine("[{0}].[{1}].[{2}]", service.MachineName, service.ServiceName, service.DisplayName); if (string.Compare(service.ServiceName, serviceName, true) == 0) { service.ExecuteCommand(commandId); } } } When I need to pass to a Windows Service more parameters than command id then I use inderect/intermediate media: files, database tables, ... Another issue is to smoothly install, run, stop, uninstall a Windows service - there should be more info on Internet and MSDN about that issues... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: 16 ???? 2011 ?. 19:58 To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] A windows Service or Not a service? I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stations and Desktops in the Platform SDK documentation. -Francisco From DWUTKA at Marlow.com Thu Jun 16 17:08:46 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 16 Jun 2011 17:08:46 -0500 Subject: [dba-VB] A windows Service or Not a service? In-Reply-To: References: Message-ID: An NT Service (as you are calling it a Windows Service) is an executable that is running on your machine and it has several different 'properties'. First, the type of startup... either manual, disabled or automatic. Automatic starts when you computer starts. Disabled means the service won't start. Secondly, there is an 'interactive' option, that determines if a service can run with an interface. For this to work, it has to have user credentials. Services with a user interface can run into all sorts of issues. I personally haven't built a service in .net yet, but have had lots of experience with them in VB 6. What you really want to do is build a service that has no interface, and then build a program that 'controls' that program. This can be done in many ways, either you can have the control change values in a database or file, that the service utilizes, or you can create various 'talking' methods, like named pipes, tcp/ip comms, etc, that allows the controlling program to directly talk to the service. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, June 16, 2011 10:58 AM To: Discussion concerning Visual Basic and related programming issues. Subject: [dba-VB] A windows Service or Not a service? I wrote a simple application that has a form and two buttons (along with a timer). My initial idea was that I would write this to be a windows service so it would auto-start whenever a specific server would reboot etc. The purpose is that I need to get new records created by a "Vendor" application and have them sent to a Second "Vendor" system. I call a custom view that I wrote that collects that last set of changes, then record by record calls a webservice on our SAP system and pushes in the new changes. My sql server version is Sql Server 2000 so it's not as easy as just writing a soap object to make the webservice call, I think it was much easier to just write the app in c# and make the call that way, which works. NOW for the tricky part. I wanted to write up the app to create a windows service installer so that my admins could log into the windows server and either start or stop the application, I also wanted to provide a gui view to the windows service so that they could choose a different timer so it could run every 1 minute (every 2 minutes, etc..) what ever they would choose. after reading MS's description on windows service classes, I noticed that supposedly the .Net Studio does not support this, but I've seen other apps that DO provide a gui view to the windows service that they introduce. so my question to the group is, have you done this before? and if so how did you go about it? -- http://msdn.microsoft.com/en-us/library/d56de412%28v=VS.90%29.aspx The Windows service classes supported by the .NET Framework do not support interaction with interactive stations, that is, the logged-on user. The .NET Framework also does not include classes that represent stations and desktops. If your Windows service must interact with other stations, you will need to access the unmanaged Windows API. For more information, see Window Stationsand Desktopsin the Platform SDK documentation. -Francisco http://bit.ly/sqlthis | Tsql and More... http://db.tt/JeXURAx | Drop Box, Storage in the Cloud (free) _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From john at winhaven.net Mon Jun 20 14:02:12 2011 From: john at winhaven.net (John Bartow) Date: Mon, 20 Jun 2011 14:02:12 -0500 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <4DF7BF32.1090405@colbyconsulting.com> References: <4DF7BF32.1090405@colbyconsulting.com> Message-ID: <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> JC, Have you put in your order yet? http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% 20Solid%20State%20Drive&idno_no=270 John B -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, June 14, 2011 3:06 PM To: Access Developers discussion and problem solving; VBA; Sqlserver-Dba Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 It has finally arrived! http://techreport.com/articles.x/16255 From jwcolby at colbyconsulting.com Mon Jun 20 14:06:57 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 20 Jun 2011 15:06:57 -0400 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> References: <4DF7BF32.1090405@colbyconsulting.com> <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> Message-ID: <4DFF9A51.60503@colbyconsulting.com> Nope, too much money for me. If they would do it for $199 I would have it on order already. John W. Colby www.ColbyConsulting.com On 6/20/2011 3:02 PM, John Bartow wrote: > http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% > 20Solid%20State%20Drive&idno_no=270 > From john at winhaven.net Mon Jun 20 14:17:41 2011 From: john at winhaven.net (John Bartow) Date: Mon, 20 Jun 2011 14:17:41 -0500 Subject: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 In-Reply-To: <4DFF9A51.60503@colbyconsulting.com> References: <4DF7BF32.1090405@colbyconsulting.com> <002301cc2f7c$8ffbdd40$aff397c0$@winhaven.net> <4DFF9A51.60503@colbyconsulting.com> Message-ID: <002701cc2f7e$b9cb6080$2d622180$@winhaven.net> LOL! Give it a couple of months. It'll be on clearance at Fry's. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, June 20, 2011 2:07 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] ACard's ANS-9010 Serial ATA RAM disk - The Tech Report - Page 1 Nope, too much money for me. If they would do it for $199 I would have it on order already. John W. Colby www.ColbyConsulting.com On 6/20/2011 3:02 PM, John Bartow wrote: > http://www.acard.com/english/fb01-product.jsp?prod_no=ANS-9010&type1_title=% > 20Solid%20State%20Drive&idno_no=270 > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com