Search Results

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

Page 12/715 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Delete all records with EDM

    - by WooBoo
    Yes, I need to clean a table and I have EDM that comes with .net 3.5 sp1 (I haven't tried with EF4). I know that works: foreach(var item in ctx.Elements){ ctx.DeleteObject(item); } but it's not a point to get all data from the table and and deleting one by one. Ok, I know it's deleted when I run ctx.SaveChanges(); but DELETE FROM [Elements] looks better :) Tried stored procedure and function import, but VS designer for EDM just doesn't work. I also couldn't find any resources about defining it in .edmx manually.

    Read the article

  • Retrieve Table Row Index of Current Row

    - by Jon
    Hi Everyone, I am trying to validate a text input when it loses focus. I would like to know which row of the table it is in. This is what I have so far and it keeps coming back as undefined. Any ideas? $("div#step-2 fieldset table tbody tr td input").blur(function() { var tableRow = $(this).parent().parent(); if ($.trim($(this).val()) == "") { $(this).addClass("invalid"); alert(tableRow.rowIndex); $(this).val(""); } else { $(this).removeClass("invalid"); checkTextChanges(); } });

    Read the article

  • Delete a header in PHP

    - by Boldewyn
    To allow caching a PHP generated file, I want to make sure, that the 'Pragma: no-cache' header is not set. However, how do I delete a possibly already set header? That is, it could be possible, that somewhere in the code someone wrote header('Pragma: no-cache'); and now I want to make sure, the header is not sent. Is it sufficient to do this: header('Pragma:'); or is there something like delete_header() (which would, apparently, be undocumented or well-hidden)?

    Read the article

  • SQL: select random row from table where the ID of the row isn't in another table?

    - by johnrl
    I've been looking at fast ways to select a random row from a table and have found the following site: http://74.125.77.132/search?q=cache:http://jan.kneschke.de/projects/mysql/order-by-rand/&hl=en&strip=1 What I want to do is to select a random url from my table 'urls' that I DON'T have in my other table 'urlinfo'.The query I am using now selects a random url from 'urls' but I need it modified to only return a random url that is NOT in the 'urlinfo' table. Heres the query: SELECT url FROM urls JOIN (SELECT CEIL(RAND() * (SELECT MAX(urlid) FROM urls ) ) AS urlid ) AS r2 USING(urlid); And the two tables: CREATE TABLE urls ( urlid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, url VARCHAR(255) NOT NULL, ) ENGINE=INNODB; CREATE TABLE urlinfo ( urlid INT NOT NULL PRIMARY KEY, urlinfo VARCHAR(10000), FOREIGN KEY (urlid) REFERENCES urls (urlid) ) ENGINE=INNODB;

    Read the article

  • Windows batch file to delete folders/subfolders using wildcards

    - by Marco Demaio
    I need to delete all folders in "tomin" folder, which name contains terminates with the ".delme" string. The deletion need to be done recurively: I mean on all directory and SUB directories. I though to do this: FOR /R tomin %%X IN (*.delme) DO (RD /S /Q "%%X") but it does not work, I think /R ignores wildcards. Before asking this quation I searched also in SO and found this: but the answers did not help me in solving my issue, following the suggestion given there I tried: FOR /F tomin "delims=" %%X IN ('dir /b /ad *.delme') DO RD /S /Q "%%X" But it did not work either. Any help aprreciated, thanks!

    Read the article

  • Listing mysql row entries from tags into one single row

    - by Derrick
    Hi guys, Ive got two tables, one a listings and another representing a list of tags for the listing table. In the listings table the tag ids are stored in a field called tags as 1-2-3- this has worked out very well for me regular expressions and joins to seperate and display the data, BUT... I now need to pull the titles of those tags into a single row. See below. listings table id tags 1 1-2-3- 2 4-5-6- tags table id title 1 pig 2 dog 3 cat 4 mouse 5 elephant 6 duck And what I need to produce out of the listings table is: id tags 2 mouse, elephant, duck any suggestions?

    Read the article

  • Merging MySQL row entries into a single row

    - by Derrick
    I've got two tables, one for listings and another representing a list of tags for the listings table. In the listings table the tag ids are stored in a field called tags as 1-2-3-. This has worked out very well for me (regular expressions and joins to separate and display the data), but I now need to pull the titles of those tags into a single row. See below. listings table id tags 1 1-2-3- 2 4-5-6- tags table id title 1 pig 2 dog 3 cat 4 mouse 5 elephant 6 duck And what I need to produce out of the listings table is: id tags 2 mouse, elephant, duck

    Read the article

  • Getting mysql row that doesn't conflict with another row

    - by user939951
    I have two tables that link together through an id one is "submit_moderate" and one is "submit_post" The "submit_moderate" table looks like this id moderated_by post 1 James 60 2 Alice 32 3 Tim 18 4 Michael 60 Im using a simple query to get data from the "submit_post" table according to the "submit_moderate" table. $get_posts = mysql_query("SELECT * FROM submit_moderate WHERE moderated_by!='$user'"); $user is the person who is signed in. Now my problem is when I run this query, with the user 'Michael' it will retrieve this 1 James 60 2 Alice 32 3 Tim 18 Now technically this is correct however I don't want to retrieve the first row because 60 is associated with Michael as well as James. Basically I don't want to retrieve that value '60'. I know why this is happening however I can't figure out how to do this. I appreciate any hints or advice I can get.

    Read the article

  • c++ new & delete and string & functions

    - by Newbie
    Okay the previous question was answered clearly, but i found out another problem. What if i do: char *test(int ran){ char *ret = new char[ran]; // process... return ret; } And then run it: for(int i = 0; i < 100000000; i++){ string str = test(rand()%10000000+10000000); // process... // no need to delete str anymore? string destructor does it for me here? } So after converting the char* to string, i dont have to worry about the deleting anymore?

    Read the article

  • How to set RequestBody for Http Delete method.

    - by Tushar Tarkas
    I am writing a client code for a server which Delete API. The API specification requires data to be sent. I am using HttpComponents v3.1 library for writing client code. Using the HtpDelete class I could not find a way to add request data to it. Is there a way to do so ? Below is the code snippet. HttpDelete deleteReq = new HttpDelete(uriBuilder.toString()); List<NameValuePair> postParams = new ArrayList<NameValuePair>(); postParams.add(new BasicNameValuePair(RestConstants.POST_DATA_PARAM_NAME, postData.toString())); try { UrlEncodedFormEntity entity = new UrlEncodedFormEntity(postParams); entity.setContentEncoding(HTTP.UTF_8); //deleteReq.setEntity(entity); // There is no method setEntity() deleteReq.setHeader(RestConstants.CONTENT_TYPE_HEADER, RestConstants.CONTENT_TYPE_HEADER_VAL); } catch (UnsupportedEncodingException e) { logger.error("UnsupportedEncodingException: " + e); } Thanks in advance.

    Read the article

  • Next and Previous MySQL row based on name

    - by NightMICU
    Hi everyone, I have a table with details on personnel. I would like to create a Next/Previous link based on the individual's last name. Since personnel were not added in alphabetical order, selecting the next or previous row based on its ID does not work. It is a hefty table - the pertinent fields are id, name_l, and name_f. I would like to order by name_l, the individuals' last name. How would I go about accomplishing this task? Thanks!

    Read the article

  • C# - Getting record from a row using DataRow

    - by pinkcupcake
    I'm trying to get record of a row using DataRow. Here's what I've done so far: uID = int.Parse(Request.QueryString["id"]); PhotoDataSetTableAdapters.MembersTableAdapter mem = new PhotoDataSetTableAdapters.MembersTableAdapter(); PhotoDataSet.MembersDataTable memTable = mem.GetMemberByID(uID); DataRow[] dr = memTable.Select("userID = uID"); string uName = dr["username"].ToString(); Then I got the error: Cannot implicitly convert type 'string' to 'int' The error points to "username". I don't know what's wrong because I'm just trying to assign a string variable to a string value. Anyone figures out the reason of the error? Please help and thanks.

    Read the article

  • jqgrid Posting name:value pair when deleting row?

    - by user837168
    I want to send some name:value pair from the row selected along with del command. from below script I want to send the "polpono" value to my php script when del command is issued. any help will be highly appreciated. $(document).ready(function(){ $("#datagrid").jqGrid({ url:'actionpo.php?vid=polpogridjq', datatype: 'xml', mtype: 'GET', colNames:['List#','PO#', 'Item Code','Item Detail','Qty','Price','Tax'], colModel :[ {name:'polistno', width:100,editable:true,editable:true,key:true}, {name:'polpono',index:'polpono', width:100,editable:true}, {name:'politemcode',index:'politemcode', width:100, align:'right',sortable:true,editable:true}, {name:'politemname', width:300, align:'left',sortable:false,editable:true}, {name:'politemqty',width:50, align:'right',sortable:false,editable:true}, {name:'politemvalue', width:80,align:'left',sortable:false,editable:true}, {name:'politemtax', width:50, align:'right',editable:true} ], pager: $('#pager'), rowNum:10, rowList:[10,20,30], sortname: 'polpono', sortorder: 'desc', shrinkToFit: false, rownumbers: false, multiselect: false, viewRecords: false, clearAfterAdd:true, caption: 'Itemised Quantity', editurl: "actionpo.php?vid=gridformcall", }).navGrid('#pager', { edit: true, add: true, del: true ,search:false, refresh:true},{ } }); });

    Read the article

  • bat script to delete file older than 7 days

    - by Jessie
    hi guys i have a bat script in which gets all files in a folder and then converts this folder with its contents into a one RAR file. This script also adds the current date once it makes a copy and moves it this file into a backup folder, i am planning to have this bat file run by a windows scheduler task every day. My question is there a way to add into this cript to also delete all rar files older than 7 days in the backup folder? for /f "delims==" %%D in ('DIR D:\scripts /A /B /S') do ( "C:\Program Files\WinRAR\WinRAR.EXE" a -agyyyy-MM-dd -r "c:\backup\scripts.rar" "%%D" )

    Read the article

  • Delete file after sharing via intent.

    - by Matt
    I'm trying to delete a temporary file after sharing it via android's Intent.ACTION_SEND feature. Right now I am starting the activity for a result and in OnActivityResult, I am deleting the file. Unfortunately this only works if I am debugging it with a breakpoint, but when I let it run freely and say, email the file, the email has no attachment. I think what is happening is my activity is deleting the file before it had been emailed. What I don't get is why, shouldn't onActivityResult only be called AFTER the other activity is finished? I have also tried deleting the file in onResume, but no luck. Is there a better way to do this?

    Read the article

  • Oracle global_names DELETE problem

    - by jyzuz
    I'm using a database link to execute a DELETE statement on another DB, but the DB link name doesn't conform to global naming, and this requirement cannot change. Also I have global_names set to false, and cannot be changed either. When I try to use these links however, I receive: ORA-02069: - global_names parameter must be set to TRUE for this operation Cause: A remote mapping of the statement is required but cannot be achieved because GLOBAL_NAMES should be set to TRUE for it to be achieved. - Action: Issue `ALTER SESSION SET GLOBAL_NAMES = TRUE` (if possible) What is the alternative action when setting global_names=true is not possible? Cheers, Jean

    Read the article

  • Delete duplicate records from a SQL table without a primary key

    - by Shyju
    I have the below table with the below records in it create table employee ( EmpId number, EmpName varchar2(10), EmpSSN varchar2(11) ); insert into employee values(1, 'Jack', '555-55-5555'); insert into employee values (2, 'Joe', '555-56-5555'); insert into employee values (3, 'Fred', '555-57-5555'); insert into employee values (4, 'Mike', '555-58-5555'); insert into employee values (5, 'Cathy', '555-59-5555'); insert into employee values (6, 'Lisa', '555-70-5555'); insert into employee values (1, 'Jack', '555-55-5555'); insert into employee values (4, 'Mike', '555-58-5555'); insert into employee values (5, 'Cathy', '555-59-5555'); insert into employee values (6 ,'Lisa', '555-70-5555'); insert into employee values (5, 'Cathy', '555-59-5555'); insert into employee values (6, 'Lisa', '555-70-5555'); I dont have any primary key in this table .But i have the above records in my table already. I want to remove the duplicate records which has the same value in EmpId and EmpSSN fields. Ex : Emp id 5 Can any one help me to frame a query to delete those duplicate records Thanks in advance

    Read the article

  • UITableViewCell Custom accessory - get the row of accessory

    - by Emil
    Hi. I have a pretty big issue. I am trying to create a favorite-button on every UITableViewCell in a UITableView. That works very good, and I currently have an action and selector performed when pressed. accessory = [UIButton buttonWithType:UIButtonTypeCustom]; [accessory setImage:[UIImage imageNamed:@"star.png"] forState:UIControlStateNormal]; accessory.frame = CGRectMake(0, 0, 15, 15); accessory.userInteractionEnabled = YES; [accessory addTarget:self action:@selector(didTapStar) forControlEvents:UIControlEventTouchUpInside]; cell.accessoryView = accessory; And selector: - (void) didTapStar { UITableViewCell *newCell = [tableView cellForRowAtIndexPath:???]; accessory = [UIButton buttonWithType:UIButtonTypeCustom]; [accessory setImage:[UIImage imageNamed:@"stared.png"] forState:UIControlStateNormal]; accessory.frame = CGRectMake(0, 0, 26, 26); accessory.userInteractionEnabled = YES; [accessory addTarget:self action:@selector(didTapStar) forControlEvents:UIControlEventTouchDown]; newCell.accessoryView = accessory; } Now, here's the problem: I want to know what row the accessory that was pressed belongs to. How can I do this? Thank you :)

    Read the article

  • Delete element from Set

    - by Blitzkr1eg
    Hi. I have 2 classes Tema(Homework) and Disciplina (course), where a Course has a Set of homeworks. In Hibernate i have mapped this to a one-to-many associations like this: <class name="model.Disciplina" table="devgar_scoala.discipline" > <id name="id" > <generator class="increment"/> </id> <set name="listaTeme" table="devgar_scoala.teme"> <key column="Discipline_id" not-null="true" ></key> <one-to-many class="model.Tema" ></one-to-many> </set> </class> <class name="model.Tema" table="devgar_scoala.teme" > <id name="id"> <generator class="increment" /> </id> <property name="titlu" type="string" /> <property name="cerinta" type="binary"> <column name="cerinta" sql-type="blob" /> </property> </class> The problem is that it will add (insert rows in the table 'Teme') but it won't delete any rows and i get no exceptions thrown. Im using the merge() method.

    Read the article

  • Determine if a directory is empty, delete it if it is and delete that directroy name from a separate list. C-shell

    - by Kg123
    I have a directory named STA. Within that directory are about 600 other directories that have the format hh:mm:ss (for example 00:01:34). Within each of these sub-directories should be three files. I also have a file, 'waveformlist', (contained within STA) which is a list of all of these sub-directories i.e.: 00:01:34 00:02:35 etc. A lot of the sub-directories do not contain these three files and are instead empty. I want to run a C-shell script to go through every sub directory and check if it is empty. If it is empty I want to delete that sub directory from the main directory STA, and also remove that sub-directory name from the list 'waveformlist'. Below is my script so far. It does not recognize when the sub-directory is empty or not and does not like the rm $dir line. Also, I do not know how to go and remove the sub-directory name from 'waveformlist'. #!/bin/csh echo "Enter name of station folder to apply filter to as 'STA' e.g. APZ:" set ans = $< cd $ans set c=0 foreach dir (*:*) if ("${c}" == 0) then echo "Empty directory:" $dir rm $dir else echo ${dir} "has files" endif end I hope I have been clear enough. Thank you.

    Read the article

  • SQL SERVER – Select and Delete Duplicate Records – SQL in Sixty Seconds #036 – Video

    - by pinaldave
    Developers often face situations when they find their column have duplicate records and they want to delete it. A good developer will never delete any data without observing it and making sure that what is being deleted is the absolutely fine to delete. Before deleting duplicate data, one should select it and see if the data is really duplicate. In this video we are demonstrating two scripts – 1) selects duplicate records 2) deletes duplicate records. We are assuming that the table has a unique incremental id. Additionally, we are assuming that in the case of the duplicate records we would like to keep the latest record. If there is really a business need to keep unique records, one should consider to create a unique index on the column. Unique index will prevent users entering duplicate data into the table from the beginning. This should be the best solution. However, deleting duplicate data is also a very valid request. If user realizes that they need to keep only unique records in the column and if they are willing to create unique constraint, the very first requirement of creating a unique constraint is to delete the duplicate records. Let us see how to connect the values in Sixty Seconds: Here is the script which is used in the video. USE tempdb GO CREATE TABLE TestTable (ID INT, NameCol VARCHAR(100)) GO INSERT INTO TestTable (ID, NameCol) SELECT 1, 'First' UNION ALL SELECT 2, 'Second' UNION ALL SELECT 3, 'Second' UNION ALL SELECT 4, 'Second' UNION ALL SELECT 5, 'Second' UNION ALL SELECT 6, 'Third' GO -- Selecting Data SELECT * FROM TestTable GO -- Detecting Duplicate SELECT NameCol, COUNT(*) TotalCount FROM TestTable GROUP BY NameCol HAVING COUNT(*) > 1 ORDER BY COUNT(*) DESC GO -- Deleting Duplicate DELETE FROM TestTable WHERE ID NOT IN ( SELECT MAX(ID) FROM TestTable GROUP BY NameCol) GO -- Selecting Data SELECT * FROM TestTable GO DROP TABLE TestTable GO Related Tips in SQL in Sixty Seconds: SQL SERVER – Delete Duplicate Records – Rows SQL SERVER – Count Duplicate Records – Rows SQL SERVER – 2005 – 2008 – Delete Duplicate Rows Delete Duplicate Records – Rows – Readers Contribution Unique Nonclustered Index Creation with IGNORE_DUP_KEY = ON – A Transactional Behavior What would you like to see in the next SQL in Sixty Seconds video? Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: Database, Pinal Dave, PostADay, SQL, SQL Authority, SQL in Sixty Seconds, SQL Query, SQL Scripts, SQL Server, SQL Server Management Studio, SQL Tips and Tricks, T SQL, Technology, Video Tagged: Excel

    Read the article

  • Row Number Transformation

    The Row Number Transformation calculates a row number for each row, and adds this as a new output column to the data flow. The column number is a sequential number, based on a seed value. Each row receives the next number in the sequence, based on the defined increment value. Develop seamlessly between Management Studio and Visual StudioSQL Connect is a Visual Studio add-in that makes it easy to keep your database and Visual Studio project in sync.

    Read the article

  • Search row with highest number of cells in a row with colspan

    - by user593029
    What is the efficient way to search highest number of cells in big table with numerous colspan (merge cells ** colspan should be ignored so in below example highest number of cells is 4 in first row). Is it js/jquery with reg expression or just the loop with bubble sorting. I got one link as below explainig use of regex is it ideal way ... can someone suggest pseudo code for this. High cpu consumption due to a jquery regex patch <table width="156" height="84" border="0" > <tbody> <tr style="height:10px"> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> </tr> <tr style="height:10px"> <td width="10" style="width:10px; height:10px" colspan="2"/> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> </tr> <tr style="height:10px"> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px" colspan="2"/> </tr> <tr style="height:10px"> <td width="10" style="width:10px; height:10px" colspan="2"/> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> </tr> </tbody> </table>

    Read the article

  • How To Delete Built-in Windows 7 Power Plans (and Why You Probably Shouldn’t)

    - by The Geek
    Do you actually use the Windows 7 power management features? If so, have you ever wanted to just delete one of the built-in power plans? Here’s how you can do so, and why you probably should leave it alone. Just in case you’re new to the party, we’re talking about the power plans that you see when you click on the battery/plug icon in the system tray. The problem is that one of the built-in plans always shows up there, even if you only use custom plans. When you go to “More power options” on the menu there, you’ll be taken to a list of them, but you’ll be unable to get rid of any of the built-in ones, even if you have your own. You can actually delete the power plans, but it will probably cause problems, so we highly recommend against it. If you still want to proceed, keep reading. Delete Built-in Power Plans in Windows 7 Open up an Administrator mod command prompt by right-clicking on the command prompt and choosing “Run as Administrator”, then type in the following command, which will show you a whole list of the plans. powercfg list Do you see that really long GUID code in the middle of each listing? That’s what we’re going to need for the next step. To make it easier, we’ll provide the codes here, just in case you don’t know how to copy to the clipboard from the command prompt. Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e  (Balanced) Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance)Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a  (Power saver) Before you do any deleting, what you’re going to want to do is export the plan to a file using the –export parameter. For some unknown reason, I used the .xml extension when I did this, though the file isn’t in XML format. Moving on… here’s the syntax of the command: powercfg –export balanced.xml 381b4222-f694-41f0-9685-ff5bb260df2e This will export the Balanced plan to the file balanced.xml. And now, we can delete the plan by using the –delete parameter, and the same GUID.  powercfg –delete 381b4222-f694-41f0-9685-ff5bb260df2e If you want to import the plan again, you can use the -import parameter, though it has one weirdness—you have to specify the full path to the file, like this: powercfg –import c:\balanced.xml Using what you’ve learned, you can export each of the plans to a file, and then delete the ones you want to delete. Why Shouldn’t You Do This? Very simple. Stuff will break. On my test machine, for example, I removed all of the built-in plans, and then imported them all back in, but I’m still getting this error anytime I try to access the panel to choose what the power buttons do: There’s a lot more error messages, but I’m not going to waste your time with all of them. So if you want to delete the plans, do so at your own peril. At least you’ve been warned! Similar Articles Productive Geek Tips Learning Windows 7: Manage Power SettingsCreate a Shortcut or Hotkey to Switch Power PlansDisable Power Management on Windows 7 or VistaChange the Windows 7 or Vista Power Buttons to Shut Down/Sleep/HibernateDisable Windows Vista’s Built-in CD/DVD Burning Features TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Gadfly is a cool Twitter/Silverlight app Enable DreamScene in Windows 7 Microsoft’s “How Do I ?” Videos Home Networks – How do they look like & the problems they cause Check Your IMAP Mail Offline In Thunderbird Follow Finder Finds You Twitter Users To Follow

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >