Search Results

Search found 17867 results on 715 pages for 'delete row'.

Page 20/715 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • A Small Utility to Delete Files recursively by Date

    - by Rick Strahl
    It's funny, but for me the following seems to be a recurring theme: Every few months or years I end up with a host of files on my server that need pruning selectively and often under program control. Today I realized that my SQL Server logs on my server were really piling up and nearly ran my backup drive out of drive space. So occasionally I need to check on that server drive and clean out files. Now with a bit of work this can be done with PowerShell or even a complicated DOS batch file, but heck, to me it's always easier to just create a small Console application that handles this sort of thing with a full command line parser and a few extra options, plus in the end I end up with code that I can actually modify and add features to as is invariably the case. No more searching for a script each time :-) So for my typical copy needs the requirements are: Need to recursively delete files Need to be able to specify a filespec (ie. *.bak) Be able to specify a cut off date before which to delete files And it'd be nice to have an option to send files to the Recycle bin just in case for operator error :-)(and yes that came in handy as I blew away my entire database backup folder by accident - oops!) The end result is a small Console file copy utility that I popped up on Github: https://github.com/RickStrahl/DeleteFiles The source code is up there along with the binary file you can just run. Creating DeleteFiles It's pretty easy to create a simple utility like DeleteFiles of course, so I'm not going to spend any talking about how it works. You can check it out in the repository or download and compile it. The nice thing about using a full programming language like C over something like PowerShell or batch file is that you can make short work of the recursive tree walking that's required to make this work. There's very little code, but there's also a very small, self-contained command line parser in there that might be useful that can be plugged into any project - I've been using it quite a bit for just about any Console application I've been building. If you're like me and don't have the patience or the persistence (that funky syntax requires some 'sticking with it' that I simply can't get over) to get into Powershell coding, having an executable file that I can just copy around or keep in my Utility directory is the only way I'll ever get to reuse this functionality without going on a wild search each time :-) Anyway, hope some of you might find this useful. © Rick Strahl, West Wind Technologies, 2005-2012Posted in Windows  CSharp   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • Writing A Transact SQL (TSQL) Procedure For SQL Server 2008 To Delete Rows From Table Safely

    In this post, we will show and explain a small TSQL Sql Server 2008 procedure that deletes all rows in a table that are older than some specified date.  That is, say the table has 10,000,000 rows in it the accumulated over the past 2 years.  Say you want to delete all but [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Permanently delete / hide a buddylist in Empathy

    - by jP_wanN
    I'm using Ubuntu 12.04 and I have a problem using empathy. I added all of my contacts to gnome-contacts and linked them with the facebook-contacts from empathy. Now they show twice in Empathy, once in the list Facebook-Friends and once in Personal. The problem is that the list Facebook-Friends is the upper one and if i minimize or delete it it gets recovered when I restart empathy, but I need to see the Personal-list because it has all my contacts, those from Facebook and those from Google Talk.

    Read the article

  • Can't format / delete locked partition from gparted?

    - by tech
    I cannot format my hard disk for ubuntu installation. It has Fedora installed in it. I wonder how to unlock the locked partition to delete and format it, since I am stucked at installing ubuntu. I am now using a livecd to do the task. No options are available for me to use. Link to screenshot: http://img822.imageshack.us/img822/7929/screenshotfrom201211151.png If you have any questions, please ask below.

    Read the article

  • How to access a row from af:table out of context

    - by Vijay Mohan
    Scenario : Lets say you have an adf table in a jsff and it is included as af:region inside other page(parent page).Now your requirement is to access some specific rows from the table and do some operations. Now, since you are aceessing the table outside the context in which it is present, so first you will have to setup the context and then you can use the visitCallback mechanism to do the opeartions on table. Here is the sample code: ================= final RichTable table = this.getRichTable();         FacesContext facesContext = FacesContext.getCurrentInstance();         VisitContext visitContext =   RequestContext.getCurrentInstance().createVisitContext(facesContext,null, EnumSet.of(VisitHint.SKIP_TRANSIENT,VisitHint.SKIP_UNRENDERED), null);         //Annonymous call         UIXComponent.visitTree(visitContext,facesContext.getViewRoot(),new VisitCallback(){             public VisitResult visit(VisitContext context, UIComponent target)               {                   if (table != target)                   {                     return VisitResult.ACCEPT;                   }                   else if(table == target)                   {                       //Here goes the Actual Logic                       Iterator selection = table.getSelectedRowKeys().iterator();                       while (selection.hasNext()) {                           Object key = selection.next();                           //store the original key                           Object origKey = table.getRowKey();                           try {                               table.setRowKey(key);                               Object o = table.getRowData();                               JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)o;                               Row row = rowData.getRow();                               System.out.println(row.getAttribute(0));                           }                           catch(Exception ex){                               ex.printStackTrace();                           }                           finally {                               //restore original key                               table.setRowKey(origKey);                           }                       }                   }                   return VisitResult.COMPLETE;               }         }); 

    Read the article

  • The DELETE statement in SQL Server

    Of the big four DML statements in SQL Server, the DELETE is the one least written about. This is odd considering the extra power conferred on the statement by the addition of the WITH common_table_expression; and the OUTPUT clause that essentially allows you to move data from one table to another in one statement. NEW! SQL Monitor 2.0Monitor SQL Server Central's servers withRed Gate's new SQL Monitor.No installation required. Find out more.

    Read the article

  • How to Delete a Virtual Directory from an FTP Site in IIS 7 and IIS 7.5 using C#/VB.Net and WMI?

    - by Steve Johnson
    Hi all. I hope everybody is doing fine. I try to delete a virtual directory using WMi (Server Manager Class) and recreate with different values. The problem i am facing is that the virtual directory is not getting deleted. Please help. Here is my code. Try Using mgr As New ServerManager() Dim site As Site = mgr.Sites(DomainName) Dim app As Application = site.Applications("/") '.CreateElement() '("/" & VirDirName) Dim VirDir As VirtualDirectory = app.VirtualDirectories.CreateElement() For Each VirDir In app.VirtualDirectories If VirDir("path") = "/" & VirDirName Then app.VirtualDirectories.Remove(VirDir) Exit For End If Next mgr.CommitChanges() End Using Catch Err As Exception Ex = Err Throw New Exception(Err.Message, Ex) End Try

    Read the article

  • DataGrid row and MVVM

    - by Titan
    Hi, I have a wpf datagrid with many rows, each row has some specific behaviors like selection changed of column 1 combo will filter column 2 combo, and what is selected in row 1 column 1 combo cannot be selected in row 2 column 1 combo, etc... So I am thinking of having a view model for the main datagrid, and another for each row. Is that a good MVVM implementation? It is so that I can handle each row's change event effectively. Question is, how do I create "each row" as a user control view? within the datagrid. I want to implement something like this: <TreeView Padding="0,4,12,0"> <controls:CommandTreeViewItem Header="Sales Orders" Command="{Binding SelectViewModelCommand}" CommandParameter="Sales Orders"/> </TreeView> Where instead of a TreeView I want a datagrid, and instead of controls:CommandTreeViewItem a datagrid row in WPF. Thanks in advance.

    Read the article

  • Problem with Delete Link?

    - by Kevin
    When I click on the delete link I created, it doesn't do anything (even the flash[:notice] part) in the controller. Am I not calling the .delete? part correctly? The POST part works as I can add tips. Link: <%= link_to "Delete", :controller => "/admin", :action => "tips", :id => t.id, :method => :delete, :confirm => "Are you sure?" %> Admin Controller def tips @tips = Tip.all if request.post? tip = Tip.new(params[:geek_tips]) if tip.save flash[:notice] = "Saved!" redirect_to :action => "tips" else flash[:notice] = "Error!" end elsif request.delete? tip = Tip.find_by_id(params[:id]) tip.delete! flash[:notice] = "Delete Message" redirect_to :action => "tips" end end

    Read the article

  • Deleting a database row with mysql - getting an error!?

    - by Nike
    Here's the code: mysql_query("DELETE " . $_GET['id'] . " FROM forum_favorites WHERE thread_id='" . $_GET['id'] . "' AND user='" . $userinfo['username'] . "'") or die(mysql_error()); And the error message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '77 FROM forum_favorites WHERE thread_id='77' AND user='nike1'' at line 1 Anyone knows what's up here? I've been stuck here for hours now and i just can't figure out what the heck's wrong? The database name and the column names are correct. Thanks. -Nike

    Read the article

  • mysqli returns only one row instead of multiple rows

    - by Tristan
    Hello, i'm totally new to mysqli and i took a generated code and adapted it for my need. public function getServeurByName($string) { $stmt = mysqli_prepare($this->connection, "SELECT DISTINCT * FROM $this->tablename where GSP_nom=?"); $this->throwExceptionOnError(); mysqli_stmt_bind_param($stmt, 's', $string); $this->throwExceptionOnError(); mysqli_stmt_execute($stmt); $this->throwExceptionOnError(); mysqli_stmt_bind_result($stmt, $row->idServ, $row->timestamp, ........... ........... $row->email); if(mysqli_stmt_fetch($stmt)) { $row->timestamp = new DateTime($row->timestamp); return $row; } else { return null; } } the problem, this example i took the template on returns only one row instead of all the records. how to fix that please ?

    Read the article

  • ASP.Net - Gridview row selection and effects

    - by Clint
    I'm using the following code in attempt to allow the user to select a gridview row by clicking anywhere on the row (plus mouse over and out) effects. The code doesn't seem to be applied on rowdatabound and I can't break into the event. (It is wired). The control is in a usercontrol, that lives in a content page, which has a masterpage. protected void gvOrderTypes_RowDataBound(object sender, GridViewRowEventArgs e) { GridView gvOrdTypes = (GridView)sender; //check the item being bound is actually a DataRow, if it is, //wire up the required html events and attach the relevant JavaScripts if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "javascript:setMouseOverColor(this);"; e.Row.Attributes["onmouseout"] = "javascript:setMouseOutColor(this);"; e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(gvOrdTypes, "Select$" + e.Row.RowIndex); } }

    Read the article

  • C++ -- How can we call "delete this; " in a const-member function?

    - by q0987
    Hello all, I saw the code snippet as follows: class UPNumber { public: UPNumber(); UPNumber(int initValue); ... // pseudo-destructor (a const member function, because // even const objects may be destroyed) void destroy() const { delete this; } // why this line is correct??? ... private: ~UPNumber(); }; First, I am sure that above class definition is correct. Here is my question, why we can define the function 'destroy' as above? The reason being asking is that why we can modify 'this' in a const-member function? Thank you

    Read the article

  • Weird Animation when inserting a row in UITableView

    - by svveet
    I have tableview which holds a list of data, when users press "Edit" i add an extra row at the bottom saying "add new" - (void)setEditing:(BOOL)editing animated:(BOOL)animated { [super setEditing:editing animated:animated]; NSArray *paths = [NSArray arrayWithObject: [NSIndexPath indexPathForRow:1 inSection:0]]; if (editing) { [[self tableView] insertRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationTop]; } else { [[self tableView] deleteRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationTop]; } } and of course the UITableView transform with animation, but weird thing is the row before the row that i just added, has different animation than all others. all rows perform "slides in" animation, but that 2nd last one did a "fade in" animation. and i didnt set any animation on the 2nd last row (or any other row), and if i didnt add the new row in, the animation slides in as normal when i switch to editing mode. somehow i cant find an answer, i check with contact app on my phone, it didnt have that weird animation as i have, when they adding a new row on editing mode. Any help would be appreciated. Thanks

    Read the article

  • C++ deleting a pointer

    - by eSKay
    On this page, its written that One reason is that the operand of delete need not be an lvalue. Consider: delete p+1; delete f(x); Here, the implementation of delete does not have a pointer to which it can assign zero. Adding a number to a pointer shifts it forward in memory by those many number of sizeof(*p) units. So, what is the difference between delete p and delete p+1, and why would making the pointer 0 only be a problem with delete p+1?

    Read the article

  • What table is affected by delete when form based on query?

    - by webworm
    In MS Access 2003 I have a form whose record source is equal to a query that involves an INNER JOIN. The join is between a location table and a container table. Containers are objects that are stored in specific locations each location and container are specified by ID values. SELECT DISTINCTROW Container.Container_ID, Location.Location_ID FROM Location INNER JOIN Container ON Location.[Location_ID] = Container.[Location_ID] What I am trying to figure out is this …. When I delete a record (using the form navigation controls) in the form based on the above query which tables are affected? Are records in the Container and Location tables deleted or is it just in the location table? Thanks!

    Read the article

  • Delete Entity in Many to Many Relation. Don't get error but entity is not deleted

    - by Shapper
    I have, in EF5, two entities: User and Role. Between User and Role there is a many to many relation. I don't have an entity for the UserRoles database which sets the relation. I have a User and I want to delete a role without loading it from the database. Context context = new Context(); User user = context.Users.First(x => x.Id == 4); user.Roles = new List<Role>(); Role role = new Role { Id = 20 }; context.Roles.Attach(role); user.Roles.Remove(role); context.SaveChanges(); I don't get any error but the role is not removed. Any idea why? Thank you, Miguel

    Read the article

  • Horizontally spacing a row of images evenly

    - by Tesla
    I have a few rows of images like so <div class="row"> <img src="image.jpg" alt=""> <img src="image.jpg" alt=""> <img src="image.jpg" alt=""> <img src="image.jpg" alt=""> <img src="image.jpg" alt=""> </div> Each image has a different width, and there is also a different number of images on each row (4-6). I want to space the images evenly in the row, the row has a fixed width of 960px. I could do this by calculating the total empty space for each row and then dividing it among the images for a margin, but I was hoping there was something simpler that I could apply to every row instead of having to calculate and code a separate one for each row.

    Read the article

  • Why can't I fade out this table row in IE using jQuery?

    - by George Edison
    I can't get the table row to fade out in IE. It works in Chrome, but not IE. It just becomes really 'light' and stays on the screen. I tried IE8 with and without compatibility mode. <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> function hideIt() { $('#hideme').fadeTo("slow", 0.0); } </script> </head> <body> <table> <tr id='hideme'> <td>Hide me!</td> </tr> </table> <button onclick='hideIt();'>Hide</button> </body> </html> Is there a workaround/solution for a smooth fade?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >