operation must use on updateable query

时间:2015-05-12 23:28:57

标签: asp.net ms-access gridview

package com.vogella.jersey.first;

import javax.servlet.annotation.WebFilter;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.client.Entity;
import javax.ws.rs.container.AsyncResponse;
import javax.ws.rs.container.Suspended;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

// Plain old Java Object it does not extend as class or implements 
// an interface

// The class registers its methods for the HTTP GET request using the @GET annotation. 
// Using the @Produces annotation, it defines that it can deliver several MIME types,
// text, XML and HTML. 

// The browser requests per default the HTML MIME type.

//Sets the path to base URL + /hello
@Path("/hello")
public class Hello {

  // This method is called if TEXT_PLAIN is request
  /*@GET
  @Produces(MediaType.TEXT_PLAIN)
  public String sayPlainTextHello() {


    return "Hello Jersey";
  }*/

    @GET
      @Produces(MediaType.TEXT_PLAIN)
      public String sayPlainTextHello() {

                return "Hello Jersey";
      }

  // This method is called if XML is request
  @GET
  @Produces(MediaType.TEXT_XML)
  public String sayXMLHello() {

    return "<?xml version=\"1.0\"?>" + "<hello> Hello Jersey" + "</hello>";
  }

  // This method is called if HTML is request
  @GET
  @Produces(MediaType.TEXT_HTML)
  public String sayHtmlHello(@Suspended final AsyncResponse response)
 {

      Thread t = new Thread()
      {
         @Override
         public void run()
         {
            try
            {
               Response jaxrs = Response.ok("basic").type(MediaType.TEXT_HTML).build();
               response.resume(jaxrs);
            }
            catch (Exception e)
            {
               e.printStackTrace();
            }
         }
      };
      t.start();


    return "<html> " + "<title>" + "Hello Jersey" + "</title>"
        + "<body><h1>" + "Hello Jersey" + "</body></h1>" + "</html> ";
  }

} 

I'm developing a project with asp.net c #. I used the GridView object in my web pages. but update, delete, insert operations in the 'must-user operation on Updateable query' I get an error. I used the access the database. I gave all the powers of puberty folder database. but the problem still continues. try, catch, finally I used the tags error still continues. please help me.!

Here's the

<asp:View ID="View2" runat="server">
  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" DataKeyNames="Kimlik" DataSourceID="SqlDataSource1" ForeColor="Black">
      <Columns>
          <asp:BoundField DataField="Kimlik" HeaderText="Kimlik" InsertVisible="False" ReadOnly="True" SortExpression="Kimlik" />
          <asp:BoundField DataField="uye_ad" HeaderText="uye_ad" SortExpression="uye_ad" />
          <asp:BoundField DataField="uye_soyad" HeaderText="uye_soyad" SortExpression="uye_soyad" />
          <asp:BoundField DataField="kadi" HeaderText="kadi" SortExpression="kadi" />
          <asp:BoundField DataField="sifre" HeaderText="sifre" SortExpression="sifre" />
          <asp:BoundField DataField="mail" HeaderText="mail" SortExpression="mail" />
          <asp:BoundField DataField="tc" HeaderText="tc" SortExpression="tc" />
          <asp:CommandField ShowEditButton="True" />
      </Columns>
      <EditRowStyle HorizontalAlign="Left" />
      <FooterStyle BackColor="#CCCCCC" />
      <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
      <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
      <RowStyle BackColor="White" Width="200px" />
      <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
      <SortedAscendingCellStyle BackColor="#F1F1F1" CssClass="&lt;br/&gt;" />
      <SortedAscendingHeaderStyle BackColor="#808080" />
      <SortedDescendingCellStyle BackColor="#CAC9C9" />
      <SortedDescendingHeaderStyle BackColor="#383838" />
  </asp:GridView>
  <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [uyeler] WHERE [Kimlik] = ?" InsertCommand="INSERT INTO [uyeler] ([Kimlik], [uye_ad], [uye_soyad], [kadi], [sifre], [mail], [tc]) VALUES (?, ?, ?, ?, ?, ?, ?)" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT * FROM [uyeler] WHERE ([mail] = ?)" UpdateCommand="UPDATE [uyeler] SET [uye_ad] = ?, [uye_soyad] = ?, [kadi] = ?, [sifre] = ?, [mail] = ?, [tc] = ? WHERE [Kimlik] = ?">
      <DeleteParameters>
          <asp:Parameter Name="Kimlik" Type="Int32" />
      </DeleteParameters>
      <InsertParameters>
          <asp:Parameter Name="Kimlik" Type="Int32" />
          <asp:Parameter Name="uye_ad" Type="String" />
          <asp:Parameter Name="uye_soyad" Type="String" />
          <asp:Parameter Name="kadi" Type="String" />
          <asp:Parameter Name="sifre" Type="String" />
          <asp:Parameter Name="mail" Type="String" />
          <asp:Parameter Name="tc" Type="String" />
      </InsertParameters>
      <SelectParameters>
          <asp:SessionParameter Name="mail" SessionField="mail" Type="String" />
      </SelectParameters>
      <UpdateParameters>
          <asp:Parameter Name="uye_ad" Type="String" />
          <asp:Parameter Name="uye_soyad" Type="String" />
          <asp:Parameter Name="kadi" Type="String" />
          <asp:Parameter Name="sifre" Type="String" />
          <asp:Parameter Name="mail" Type="String" />
          <asp:Parameter Name="tc" Type="String" />
          <asp:Parameter Name="Kimlik" Type="Int32" />
      </UpdateParameters>
  </asp:SqlDataSource>
</asp:View>

0 个答案:

没有答案
相关问题