Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4607372
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:41:38+00:00 2026-05-22T00:41:38+00:00

I just got this message from Visual Studio 2005, when I clicked on the

  • 0

I just got this message from Visual Studio 2005, when I clicked on the delete command I added to my gridview using the interface for configuring the grid:

Deleting is not supported by data
source ‘transactionsSqlDataSource’
unless DeleteCommand is specified.

How can I activate that? I want my user to be able to delete a row when they click on the button Delete.

I already changed the property DeleteCommandType of my SQLDataSource to StoredProcedure.
What else do I need to do?

UPDATE

This is what I did, but I am missing something, I can’t compile:

This is what I did at .cs:

public string DeleteCommand { get; set; }

How can I fix that, it says that the get is missing the body. I am not use to ASP.NET. Could you help me fixing this part of my code?

This is what I did at .aspx:

<asp:SqlDataSource ID="transactionsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:membershipsDBConnectionString %>"
        SelectCommand="SELECT [brukerId], [kjoptekvoten], [pengeneutbetalt], [fyringsolje], [biltype], [kjoptid] FROM [Informasjon]" DeleteCommandType="StoredProcedure"
        DeleteCommand="DELETE FROM [Informasjon] WHERE fyringsolje='Kull: 2,42 kg';">
    </asp:SqlDataSource>

Is the configuration for the datasource correct? Dont worry if you see that the delete command does not use parameters like the one above, it is just for a homework(I only need the query to pass).

UPDATE 2
I keep trying but i cant fix it. I am really newbie in ASP.NET and I am not very familiar with all the terminology. What exactly is happening here? How can I know the name of my store procedure?:

CS:

public string DeleteCommand { get { return DeleteCommand; } set { DeleteCommand = "";} 

Aspx:

<asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:membershipsDBConnectionString %>"
        DeleteCommandType="StoredProcedure" SelectCommand="SELECT [id], [kjoptekvoten], [pengeneutbetalt], [fyringsolje], [biltype], [kjoptid] FROM [Informasjon]"
        DeleteCommand="StoredProcedureName">
    </asp:SqlDataSource>

When I click on Delete that row needs to be erased from table Informasjon
Screenshot of GridView

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:41:39+00:00Added an answer on May 22, 2026 at 12:41 am

    You can either call a stored procedure if you have created one like below :

    <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        // in the select command or your case delete you just input the name instead of a query
        SelectCommand="SELECT * FROM [Table] WHERE [Column1]=@Parameter1 AND [Column2]=@Parameter2 AND [Column3]=@Parameter3;" 
        DeleteCommand="StoredProcedureName"
        // Then ofcourse put the commandtype on storedprocedure but you already have that
        DeleteCommandType="StoredProcedure">
        // And you can declare the parameters like below
        <SelectParameters>
            <asp:Parameter Name="Parameter1" Type="String" />
            <asp:Parameter Name="Parameter2" Type="Boolean" />
            <asp:Parameter Name="Parameter3" Type="String" />
            <asp:Parameter Name="Parameter4" Type="Boolean" />
        </SelectParameters>
        <DeleteParameters>
             <asp:Parameter Name="Parameter1" Type="String" />
        </DeleteParameters>
    </asp:SqlDataSource>
    

    For more information about storedprocedures please read : What is a stored procedure?
    Or you can directly call a query like in the example below :

    <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT * FROM [informasjon];"
        DeleteCommand="DELETE FROM [informasjon] WHERE [id]=@id;">
        <DeleteParameters>
             <asp:Parameter Name="id" Type="Int" />
        </DeleteParameters>
    </asp:SqlDataSource>
    

    The connection string is something you will have to provide for yourself. For more info on the connectionstring please read : https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring%28v=vs.110%29.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just got this error message: ... from c:/ruby/lib/ruby/gems/1.8/gems/... ... 10 levels... from c:/ruby/lib/ruby/gems/1.8/gems/...
How could this be happening? sqlite> select read, text from message; 1|No just got
I just got Java5 project that has this error, i tried using Java5 and
Just got a question about generics, why doesn't this compile when using a generic
I got this síngleton cache object and it exposes an IEnumerable property which just
I just installed the first release candidate of Python 3.0 and got this error
This has got to be something I just missed, but how do I add
Ok, this has got to be a super simple problem. I just can't seem
Just got a request from my boss for an application I'm working on. Basically
I just got a dedicated server from a hosting company, and for some reason,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.