.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

exception using delete could't properly delete elements

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :JavaScript/VBScript
 
struct mystruct
{
    int *p;
};


void main ()
{
    int c = 0 ;
    mystruct *s = NULL;
    s = new mystruct ;
    s->p = new int[5];
   
    if (s == NULL)
        cerr<<"out memory";
   
    //return ;

    for (c = 0; c < 5 ; c++)
    {   
        cin>>s->p[c];
    }
    for (c = 0 ; c < 5 ; c++)
        cout<<s->p[c]<<endl;

    for (c = 0 ; c < 5 ; c++)
    {
        delete [] s[c].p;
        s->p[c] = NULL;
    }
    delete s->p;
    delete s;
   
   
getchar();
getchar();
}
Asia


View Complete Post


More Related Resource Links

How to properly configure permissions so users can view, add, edit, and delete list items, but not w

  
I am trying to figure out how to properly setup security so that it can be configured at the top-level, and then inherited all the way through. Here is what I would like to do: Each user can view, add, edit, and delete list items - but, users cannot modify or delete web part pages. The only way I know how to do this is set Contribute from the top-down, and then go into each Site Pages library and set Read access. The problem is that I have 100 sites, and I was hoping there was a way I could set security at the top, and inherit downward. Rather than having to go into all 100 Site Pages library and set Read access. Is there a way to do this? Thanks in advance.

Field type Choice is not installed properly. Go to the list settings page to delete this field.

  
Has anyone received this error message and know how to deal with it? Field type  Choice  is not installed properly. Go to the list settings page to delete this field. I have received this error three times now, once when trying to add a 'List Definition From Content Type' in Visual Studio twice when trying to add from existing site columns in Sharepoint in the list settings and library settings from the ribbon from a list and a document library.

Application Exception Rule Violation thrown on Delete

  
I basically have my first simple asp.net MVC 2.0 web application up and running except for deletes. I tried to do the first delete today, but it throws an exception with the text Rules Violation.  I'm not sure what is causing the error however.It shouldn't be the database (I don't think) because when I trace the database, I never see the delete call and after having it fail, I was able to sucessfully run:DELETE FROM [Work] WHERE work_id = 84 GOCurrently this is my method (yes its primitive, but I was just trying to get it working), its the db.SubmitChanges() line where the application exception gets thrown. [HttpPost] public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here var result = db.Works.SingleOrDefault(w => w.work_id == id); if (result == null) return View("NotFound"); db.Works.DeleteOnSubmit(result); db.SubmitChanges(); return RedirectToAction("Index"); } catch { var result = db.Works.SingleOrDefault(w => w.work_id == id); return View(result); } } }This may be a Linq-to-Sql issue as this is really the first time I've us

Delete document library throws "Exception from HRESULT: 0x80040E14" error

  

I am running WSS 3.0 SP2 running the Feb 2010 cumulative update. I have a particular document library I am attempting to delete. When I click on delete in the GUI, I get a page that says "Exception from HRESULT: 0x80040E14". Everything I've found so far on the web says this is caused by a SQL server that is out of space. That is not the problem in my case.

Additionally, I have looked at the logs in Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\LOGS and found the root cause. When I try to delete this document library, two errors are added to the log. They are

  • 06/16/2010 09:45:55.72     w3wp.exe (0x1798)                           0x0D44    Windows SharePoint Services       Database                          6f8g    Unexpected    Unexpected query execution failure, error code 8144. Additional error information from SQL Server is included below. "Procedure or function proc_SecGetI

spfile.delete gives file is checked out or locked for editing exception.

  

hello friends,

i have developed a custom webservice wherein i try to move the spfile within a document library between two folders. I tried with spfile.delete but it gives me exception.

System.Runtime.InteropServices.COMException (0x8107090E): The file is a user http://tsnt4-test/espis/Lists/TSAkJKDocuments/154545445-342423/abc.doc DMTSIT \ spospisilova checked out or locked for editing.

even when i try to use spfile.copyTo and spfile.moveTo it gives me the same exception

i used the following two approaches

  //Approach 1
                          &nb

How To Properly Delete A File Using File.Delete()

  

Hello:

My Code below Writes a file to the directory _photo/tempstuff from an Upload Control ( upload_Art )
It then resizes the file, and then is suppose to delete the file

Well It is not deleting the file.  Even when I go into Filezilla (my ftp client), and try to delete the file from my server,
I get a message " 550 The process cannot access the file because it is being used by another process.  "

So is there something I have to do to release the file after it is created so that it can be delete?
Or is there something I have to do after the command that is suppose to delete the file ( File.Delete(imgFileName ) to release it
so that it can actually be deleted?

Please help, for as you can imagine, If I can't delete temp files from my server, I will run out of storage space!

Thanks!!!

IIS 7.0 and ASP 4.0 on the server...

The Directory In Question on my Shared Hosting Server Only lets me set:

Set permissions for selected folders.
 Inherit  (Inherit permissions from parent directory)  
 Read   (Directory contents are visible to users)  
 Write   (Applications can write to this directory)  
 
I have the Read and Write Selected

I am usually able to delete files at least fro

the insert trigger works properly, the delete trigger does not.....what do you think

  

INSERT TRIGGER

ALTER TRIGGER [dbo].[CREER_SOMMAIRE_PARTIE_JOUEUR] ON [dbo].[SOMMAIRE_PARTIE]

FOR INSERT
  as

DECLARE     @NB_BUT int,
            @RESULTAT_VISITEUR int,
            @ID_EQUIPE_VISITEUR int,
            @ID_EQUIPE_LOCAL int,
            @ID_EQUIPE_JOUEUR int,
            @RESULTAT_LOCAL int,
            @NB_PASSE int,
            @NB_MINUTE_PUNITION int,
            @NB_BUT_TOTAL_JOUEUR int,
            @NB_PASSE_TOTAL_JOUEUR int,
            @NB_MINUTE_PUNITION_JOUEUR int


/* Sélectionner le nombre de but inscrit par un joueur */
SELECT @NB_BUT = NB_BUT
FROM inserted SOMMAIRE_PARTIE

/* Sélectionner le résultat avant tout changement de l'équipe visiteur */
SELECT @RESULTAT_VISITEUR = RESULTAT_VISITEUR
FROM PARTIE
    join SOM

How can add, modify, delete security elements in SOAP header. Catch localhost comunication.

  

Hi. I have a problem with configuring security in bindings for SOAP message security (WS-Security). When I use wsHttpBinding in configuration file without any modification of binding and service behaviour and i use [ServiceContract(ProtectionLevel = ProtectionLevel.None)] for my service the result soap request from wcf test client utility is:

 

<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
 <s:Header>
  <a:Action

exception error delete operator error

  
struct mystruct
{
    int *p;
};


void main ()
{
    int c = 0 ;
    mystruct *s = NULL;
    s = new mystruct ;
    s->p = new int[5];
   
    if (s == NULL)
        cout<<"out memory";
    getchar();
    return ;

    for (; c < 5 ; c++)
    {   
        cin>>s->p[c];
    }
    for (c = 0 ; c < 5 ; c++)
        cout<<s->p[c]<<endl;

    for (c = 0 ; c < 5 ; c++)
    {
        delete s[c].p;
        s[c].p = NULL;
    }
        delete s;
   
   
getchar();
getchar();
}

its giving me exection i was trying to store some values and then cout them but its gives exception
Asia

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

  
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

SqlCommand.ExecuteNonQuery() returns -1 when doing Insert / Update / Delete

  
Sometimes you end up with a return value of -1 when using the SqlClient.SqlCommand.ExecuteNonQuery method.

Why is that?



Well, the ExecuteNonQuery method is there for statements for changing data, ie. DELETE / UPDATE /INSERT, and the returned value are the number of rows affected by that statement.

When checking the documentation we can see that there are some conditions that return -1.



For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.

When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of

rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.

update/delete not working on server only

  

my aspx page works in VWD, and everything works on the server EXCEPT update and delete sql functions. any ideas?

thanks 


How to use TOP in DELETE

  

Hi,

I have a large database in MSSQL 2005 (rows around 3,788,299 : size 4GB)

Two questions

1. SQL query ~ select top 100 * from [tablename], how do capture the next 100 record?

2. SQL query ~ delete top 100 from [tablename] --- MSSQL show me syntax error? How can I only delete the top 100 record?

 

thk.


delete record from excel sheet

  



Hello,

           I have write the code for deleting the data in excel sheet. but we have got the error" Deleting data in a linked table is not supported by this ISAM."

     below I paste some code snippest.

string strDelete = "Delete  from [" + strSheetName + "$]";

            cmdExcel.Connection = con;
            cmdExcel.CommandType = CommandType.Text;
            cmdExcel.CommandText = strDelete;

            cmdExcel.ExecuteNonQuery();


Please can anybody this answer.It is urgent


delete data in excel sheet

  

Hello,

           I have write the code for deleting the data in excel sheet. but we have got the error" Deleting data in a linked table is not supported by this ISAM."

     below I paste some code snippest.

string strDelete = "Delete  from [" + strSheetName + "$]";

            cmdExcel.Connection = con;
            cmdExcel.CommandType = CommandType.Text;
            cmdExcel.CommandText = strDelete;

            cmdExcel.ExecuteNonQuery();


Please can anybody this answer.It is urgent




Add, Edit, update, Delete gridview

  
The article Add, Edit, update, Delete gridview was added by anjankant on Friday, July 09, 2010.

Thousandas operation we can do on Gridview control. Here I as explaining how we can add new recored and edit of existing record and delete a record in Gridview. Step1 : You can add this gridview in your aspx form. Here some events of Gridview are fired
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend