Search Results

Search found 19688 results on 788 pages for 'con current'.

Page 9/788 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Will this class cause memory leaks, and does it need a dispose method? (asp.net vb)

    - by Phil
    Here is the class to export a gridview to an excel sheet: Imports System Imports System.Data Imports System.Configuration Imports System.IO Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Namespace ExcelExport Public NotInheritable Class GVExportUtil Private Sub New() End Sub Public Shared Sub Export(ByVal fileName As String, ByVal gv As GridView) HttpContext.Current.Response.Clear() HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", fileName)) HttpContext.Current.Response.ContentType = "application/ms-excel" Dim sw As StringWriter = New StringWriter Dim htw As HtmlTextWriter = New HtmlTextWriter(sw) Dim table As Table = New Table table.GridLines = GridLines.Vertical If (Not (gv.HeaderRow) Is Nothing) Then GVExportUtil.PrepareControlForExport(gv.HeaderRow) table.Rows.Add(gv.HeaderRow) End If For Each row As GridViewRow In gv.Rows GVExportUtil.PrepareControlForExport(row) table.Rows.Add(row) Next If (Not (gv.FooterRow) Is Nothing) Then GVExportUtil.PrepareControlForExport(gv.FooterRow) table.Rows.Add(gv.FooterRow) End If table.RenderControl(htw) HttpContext.Current.Response.Write(sw.ToString) HttpContext.Current.Response.End() End Sub Private Shared Sub PrepareControlForExport(ByVal control As Control) Dim i As Integer = 0 Do While (i < control.Controls.Count) Dim current As Control = control.Controls(i) If (TypeOf current Is LinkButton) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, LinkButton).Text)) ElseIf (TypeOf current Is ImageButton) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, ImageButton).AlternateText)) ElseIf (TypeOf current Is HyperLink) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, HyperLink).Text)) ElseIf (TypeOf current Is DropDownList) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, DropDownList).SelectedItem.Text)) ElseIf (TypeOf current Is CheckBox) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, CheckBox).Checked)) End If If current.HasControls Then GVExportUtil.PrepareControlForExport(current) End If i = (i + 1) Loop End Sub End Class End Namespace Will this class cause memory leaks? And does anything here need to be disposed of? The code is working but I am getting frequent crashes of the app pool when it is in use. Thanks.

    Read the article

  • Will this class cause memory leaks, and does anything need disposing of? (asp.net vb)

    - by Phil
    Here is the class to export a gridview to an excel sheet: Imports System Imports System.Data Imports System.Configuration Imports System.IO Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Namespace ExcelExport Public NotInheritable Class GVExportUtil Private Sub New() End Sub Public Shared Sub Export(ByVal fileName As String, ByVal gv As GridView) HttpContext.Current.Response.Clear() HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", fileName)) HttpContext.Current.Response.ContentType = "application/ms-excel" Dim sw As StringWriter = New StringWriter Dim htw As HtmlTextWriter = New HtmlTextWriter(sw) Dim table As Table = New Table table.GridLines = GridLines.Vertical If (Not (gv.HeaderRow) Is Nothing) Then GVExportUtil.PrepareControlForExport(gv.HeaderRow) table.Rows.Add(gv.HeaderRow) End If For Each row As GridViewRow In gv.Rows GVExportUtil.PrepareControlForExport(row) table.Rows.Add(row) Next If (Not (gv.FooterRow) Is Nothing) Then GVExportUtil.PrepareControlForExport(gv.FooterRow) table.Rows.Add(gv.FooterRow) End If table.RenderControl(htw) HttpContext.Current.Response.Write(sw.ToString) HttpContext.Current.Response.End() End Sub Private Shared Sub PrepareControlForExport(ByVal control As Control) Dim i As Integer = 0 Do While (i < control.Controls.Count) Dim current As Control = control.Controls(i) If (TypeOf current Is LinkButton) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, LinkButton).Text)) ElseIf (TypeOf current Is ImageButton) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, ImageButton).AlternateText)) ElseIf (TypeOf current Is HyperLink) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, HyperLink).Text)) ElseIf (TypeOf current Is DropDownList) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, DropDownList).SelectedItem.Text)) ElseIf (TypeOf current Is CheckBox) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, CheckBox).Checked)) End If If current.HasControls Then GVExportUtil.PrepareControlForExport(current) End If i = (i + 1) Loop End Sub End Class End Namespace Will this class cause memory leaks? And does anything here need to be disposed of? The code is working but I am getting the app pool falling over frequently when it is in use. Thanks.

    Read the article

  • iphone mapview current location

    - by satyam
    I'm able to show current location on mapview. It shows round blue color circle. When I click on the circle, it shows "Current Location". I want to show users current location as green pin. on click of pin, i want to show "My Location" annotation. How to do it. Please suggest me how to do it.

    Read the article

  • How to round current time in teradata and insert into timestamp(6) feilds

    - by user3471254
    I have a table with date fields of timestamp(6) fields . create table test_time ( t1 timestamp(6) format 'mm/dd/yyyy hh:mm:si' , ); I want to insert into this table with current date and time rounded. i.e. say for example if the current date time is 08/07/2014 10:34:56 then the value in the table should be 08/07/2014 10:00:00 . (or) if current data and time is 08/07/2014 10:54:56 then also the value should be 08/07/2014 10:34:56

    Read the article

  • Referencing the current jQuery object in a chain?

    - by Lance McNearney
    At DevDays in SF last year (before jQuery 1.4 was released), I thought they mentioned an upcoming feature in 1.4 that would allow you to reference the current jQuery object while in a chain. I've read through all of the 1.4 improvements and wasn't able to find it. Does anyone know how this can be done? Example Being able to access the current jQuery object would be helpful when working with methods that are in relation to the current object like .next(): // Current way var items = $(this).closest('tr'); items = items.add(items.next(':not([id])')); // Magical 1.4 way? Is there a "chain"-like object? var items = $(this).closest('tr') .add(chain.next(':not([id])'));

    Read the article

  • next element is (current+1) or 0 (ruby)

    - by Radek
    I have an interval let's say (0..3) where next element is +1 unless the last. Then the next is 0. I solved it by the code below. Just wondering if there is anything else outhere :-) def next(max,current) if current+1 == max return 0 else return current+1 end end

    Read the article

  • JQuery datepicker numberOfMonths: display current selection month last

    - by Paul
    Hi, I have a jquery datepicker with the numberOfMonths set to 3, currently when I click on the datepicker, the left side month is the current month. In most cases, the user is only going to be selecting a date prior to todays date so I would prefer the current month selected to be the last calendar i.e. March, April, May instead of the current implementation which is May, June, July. Greatly appreciate any help!

    Read the article

  • fopen doesn’t create file in the current directory

    - by indira
    I have created a console application in VS2010 and I want to create a file in the current directory where the exe runs. I used the following code fp = fopen("Pkts.csv", "w+"); But file is not getting created in the current directory. But when I specifies the path as fp = fopen("C:\\Windows\\Pkts.csv", "w+"); the file gets created in the path specified. How to create the file in the current directory?

    Read the article

  • The cross-thread usage of "HttpContext.Current" property and related things

    - by smwikipedia
    I read from < Essential ASP.NET with Examples in C# the following statement: Another useful property to know about is the static Current property of the HttpContext class. This property always points to the current instance of the HttpContext class for the request being serviced. This can be convenient if you are writing helper classes that will be used from pages or other pipeline classes and may need to access the context for whatever reason. By using the static Current property to retrieve the context, you can avoid passing a reference to it to helper classes. For example, the class shown in Listing 4-1 uses the Current property of the context to access the QueryString and print something to the current response buffer. Note that for this static property to be correctly initialized, the caller must be executing on the original request thread, so if you have spawned additional threads to perform work during a request, you must take care to provide access to the context class yourself. I am wondering about the root cause of the bold part, and one thing leads to another, here is my thoughts: We know that a process can have multiple threads. Each of these threads have their own stacks, respectively. These threads also have access to a shared memory area, the heap. The stack then, as I understand it, is kind of where all the context for that thread is stored. For a thread to access something in the heap it must use a pointer, and the pointer is stored on its stack. So when we make some cross-thread calls, we must make sure that all the necessary context info is passed from the caller thread's stack to the callee thread's stack. But I am not quite sure if I made any mistake. Any comments will be deeply appreciated. Thanks. ADD Here the stack is limited to user stack.

    Read the article

  • 'txn-current-lock': Permission denied [500, #13] - Subversion + Apache Configuration Issue

    - by wfoster
    Current Setup Fedora 13 32bit Apache 2.2.16 Subversion repositories setup under /var/www/svn I have two different repositories under this directory so my /etc/httpd/conf.d/subversion.conf setup in this way; LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so <Location /svn> DAV svn SVNListParentPath on SVNParentPath /var/www/svn <LimitExcept GET PROPFIND OPTIONS REPORT> AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/httpd/.htpasswd Require valid-user </LimitExcept> </Location> After copying over my repos and using; chmod 755 -R /var/www/svn chcon -R -t httpd_sys_content_t /var/www/svn chown apache:apache -R /var/www/svn I can browse my repos fine through the browser, and I can update all my working copies, however when I try to check in from anywhere I get the same error Can't open file '/var/www/svn/repo/db/txn-current-lock':Permission denied I have been working on this issue for a while now and cant seem to find a solution to my issues. It might be of some use to know that the repo existed on a different server before this, it has been now moved to this new server. Everything I have read seems to indicate that the permissions for apache are incorrect, however apache is set to run as User apache and Group apache. So as far as I can tell my setup is correct. The behavior is not though. Any Ideas? Solution The only way I was able to get this to work is to disable SELinux, it could also be done by setting the proper booleans with SELinux via setsetbool and getsebool since this is just a home server, I decided to disable SELinux and am reaping the benefits now.

    Read the article

  • Unable to start Server Service on remote machine (2 replies)

    hi, i am trying to start Server service thru .net code on remote machine but unable to do so. here is the code.. ConnectionOptions con new ConnectionOptions(); con.Authority &quot;ntlmdomain:DomainName&quot;; con.Username &quot;x&quot;; con.Password &quot;123456&quot;; con.Impersonation ImpersonationLevel.Impersonate; con.Authentication AuthenticationLevel.Packet; con.EnablePrivileges true; ManagementScope ms new ManagementSco...

    Read the article

  • Unable to start Server Service on remote machine (2 replies)

    hi, i am trying to start Server service thru .net code on remote machine but unable to do so. here is the code.. ConnectionOptions con new ConnectionOptions(); con.Authority &quot;ntlmdomain:DomainName&quot;; con.Username &quot;x&quot;; con.Password &quot;123456&quot;; con.Impersonation ImpersonationLevel.Impersonate; con.Authentication AuthenticationLevel.Packet; con.EnablePrivileges true; ManagementScope ms new ManagementSco...

    Read the article

  • Running Safari from the command line adds current directory to the URL

    - by Charles Anderson
    I am trying to run the Safari browser (on Mac OS 10.4) from the command line, as follows: /Applications/Safari.app/Contents/MacOS/Safari http://localhost/dev/myfile.html However, Safari starts up and tries to access file:///Users/charlesanderson/scripts/http://localhost/dev/myfile.html /Users/charlesanderson/scripts happens to be my current directory. Can someone explain why Safari does this? Firefox is much better behaved?

    Read the article

  • How to see active connections and "current activity" in PostgreSQL 8.4

    - by Evgeny
    I'm investigating an issue with DB connections being left open indefinitely, causing problems on the DB server. How do I see currently open connections to a PostgreSQL server, particularly those using a specific database? Ideally I'd like to see what command is executing there as well. Basically, I'm looking for something equivalent to the "Current Activity" view in MSSQL.

    Read the article

  • Dynamically set current domain in nginx with perl module

    - by Simone Margaritelli
    i know how to set variables and use subroutines with the nginx builtin perl module INSIDE a "server" directive but, what i need to do is to set/rewrite the current domain before ... let's say, we have a domain like admin.foobar.website.com i want that a request to foobar.othersite.com points to the first address ( obviously website.com and othersite.com are hosted on the same webserver running nginx :) ). For reasons i can't explain here, i can not use multiple server_name directive expressions, i have to do this before the server {} block, with perl or anyway possible. Thanks

    Read the article

  • How did you find your current job?

    - by sanksjaya
    I'm a student looking for a job as a Jr. Sys Admin / Information Security position. The moment I click search from simplyhired.com or dice.com my job gets complicated. It's so hard to spot the ones that you definitely want to apply for. So, just share your story of how you spot your current job online? What factors did you consider before applying? And any tips for young job seekers. Thanks :)

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >