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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

No overload for method 'Delete' takes 3 arguments

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :ASP.Net


[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
     public bool DeleteProduct(int original_ID, string original_Priimek)


    Guid original_UserId = Guid.NewGuid();

    int rowsAffected = Adapter.Delete(original_ID, original_UserId, original_Priimek);

   // Return true if precisely one row was deleted, otherwise false
   return rowsAffected == 1;

string original_Priimek - not found

Please help

View Complete Post

More Related Resource Links

Compiler Error Message: CS1501: No overload for method 'EndExecuteNonQuery' takes '0' arguments



I have a page that add and edit news. and 2 class file


public class PageDataAccess:Page
    protected DataAccess DA=new DataAccess();

    protected void Page_UnLoad(object sender, EventArgs e)


public class DataAccess
    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MisrNewsConn"].ToString());
    public DataAccess()
		// TODO: Add constructor logic here
    public void DataClose()
    public int addEditNews(string Nid,string title, string summary, string detail, string cid, bool Ishome, bool IsMain, byte[] image)
        SqlCommand cmd = new SqlCommand("StoredProcedure1", conn);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@IsMain", IsMain);

Overload POST with X-HTTP-Method-Override as DELETE

Hi, How do I pass POST with the override header, X-HTTP-Method-Override, which will say I really mean DELETE in REST WCF 3.5? What changes are needed exactly in server side REST code & where to make those changes exactly? Can some one post code snippet? Thanks!

The best overloaded method match for... has some invalid arguments

I have a compilation error generated by this scenario: i have : 1. DataAccessLayses 2. Entity 3. PresentationLayer(web application)4. BankServices(web service) inside the webservice i have one web method with argument of my pre-defined class library it name is CustomerEL and the class in PresentationLayer calling the webservice method ,CustomerEL cusE = new CustomerEL();objsv.addCustomer(cusE);(addCustomer(<argument>) is method in BankServices)  and here the eror occuredcan you help me !Regards

arguments null in onSuccess method

HiI'm trying to validate user input into a textbox via a web service.I'm using a Dynamic Data site, with a custom Dynamic Data field to show this particular value. In the dynamic data field I've added a custom validator - <asp:CustomValidator id="CustomValidator1" runat="server"        ErrorMessage="Invalid Item ID!"      ControlToValidate="TextBox1"      OnServerValidate="ServerValidate"      ClientValidationFunction="validateItem"     /><asp:CustomValidator id="CustomValidator1" runat="server" ErrorMessage="Invalid Item ID!" ControlToValidate="TextBox1" OnServerValidate="ServerValidate" ClientValidationFunction="validateItem" />In a custom page, I have the following Javascript - <script type="text/javascript"> <!-- function validateItem(source, arguments) { InventTableService.exists(arguments.Value, onComplete, onError); } function onComplete(source, arguments) { alert(source); arguments.IsValid = source; }

How to set an overload group on arguments in the workflow designer?



I'm wondering how to set an overload group (http://msdn.microsoft.com/en-us/library/ee358733.aspx) to arguments using the workflow designer. If I click on an argument in the Arguments tab in Visual Studio, the properties window shows a checkbox for the Required attribute, but no property for the OverloadGroup.

Is there a way to use overload groups in the designer?

Thanks in advance,

On clicking a button, call a method with extra arguments


I have a small question about Button.Click events, namely how can I call a method with some extra arguments?

My code is this:

btn.Click += new RoutedEventHandler(Method);

But I would really like it to be of the following form:

btn.Click += new RoutedEventHandler(Method(x));

That is, having an extra argument. However, this does not work.

How can I create something that has the desired operation?

How to marshal safearray arguments when calling managed C# method from unmanaged C++?


I'm trying to utilize an old application framework from managed C# code but I don't understand how to marshal the safearray argument which is forwarded to the managed code. Here is a code snipped describing how the managed code is called:

  try {
    _ObjectHandlePtr pObjectHandle; 
    _ObjectPtr pObject; 
    _TypePtr pType;
    SAFEARRAY* psa;

    // Create an instance of a type from an assembly
    pObjectHandle = pDefaultDomain->CreateInstanceFrom(L"ClassLibrary1.dll",   // no path -- local directory
    variant_t vtobj = pObjectHandle->Unwrap();                   // Get an _Object (as variant) from the _ObjectHandle
    vtobj.pdispVal->QueryInterface(__uuidof(_Object),(void**)&pObject); // QI the variant for the Object iface
    pType = pObject->GetType();                             // Get the _Type iface
    psa = SafeArrayCreateVector(VT_VARIANT,0,1);               // Create 

Single insert/delete takes more than 5 sec on merge replicated table.


Dear experts,

Environment: MSSQL standard edition – 2008 / Windows server 2008 (64 bit)

I have lots of tables with merge publication (filtered) on windows 2008 server and it takes few seconds to insert/ delete single row on that database.


This is what execution plan shows.

Delete single row: 7 sec. It shows 47 queries.

Insert single row (2 columns): 4 sec. 35 queries.


What I can see it MSmerge_past_partition_mappings and MSmerge_current_partition_mappings table take 15%-30% of cost.


Please help to to resole this issue. I can send execution plan if anyone interested. 

Delete file in a subfolder using Updatelistitems web method



I need to delete zip file under my folder and sub folders which are under the list name named "Documents", so i used



GetListItems web method and got the list zip files. When i try to delete the same i am not able to delete the ones that are in the folders (i.e) if the zip file is under [http://server/mysite/Documents/Folder/aaa.zip].

I am adding the line of code which am using for deleting the file from the list.

 XmlDocument xmlDoc = new System.Xml.XmlDocument (); 

Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

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.

Sys.Net.WebServiceFailedException: The server method '' failed with the following error:



Let's say we have 2 time consuming functions, aaa and aaa1 inside a aspx page.

        public static string aaa(int i)
            return i.ToString();

        public static string aaa1(int i)
            return i.ToString();



        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        <span id="displayspan"></span>
        <br />
        <input type="button" value=

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

Using CreateNewUserWizard SendingMail method to email me, not applicatnt.


I have staff area of my site I am protecting with forms authentication using c# and .Net 4.0. What I want to do is let the staff members register on the site but instead of the confermation email being sent to them I want it sent to me so I can go in and approve it. I have been trying to use the SendingMail method  but can not figure out how to get it to email me instead of the person that registered. I have searched around this site and find many topics on the SendingMail method but none seem to properly address my issue. Can anyone help me out?

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?


How to use TOP in DELETE



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?



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