detailview update

G

Guest

Hi

i am trying to change my value in my gridview but it does not work?
any ideas?

thanks

Bert

<%@ page language="VB" %>

<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Detailsview1.ChangeMode(DetailsViewMode.Edit)
Me.Detailsview1.Rows(2).Cells(1).Text = "new value for lastname"

End Sub
</script>

<html>
<head runat="server">
<title>Details View</title>
</head>
<body>
<form runat="server">
<asp:sqldatasource runat="server" id="MySource"

connectionstring="server=(local);database=northwind;trusted_connection=yes"

selectcommand="SELECT employeeid, firstname, lastname, photo
FROM employees"
updatecommand="UPDATE employees SET firstname=@firstname,
lastname=@lastname WHERE employeeid=@employeeid"
deletecommand="DELETE employees WHERE employeeid=@employeeid" />

<asp:detailsview runat="server" id="Detailsview1"
datasourceid="MySource" AutoGenerateEditButton=true
AutoGenerateInsertButton=true allowpaging="true"
pagersettings-mode="NextPreviousFirstLast" />
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DetailView 1
DetailView 0
Help... DetailView won't update... 0
Gridview not updating data 1
DetailView 3
formview not updating record 0
asp.net dropdown using xsl output 8
Gridview Problems with asp.net 2.0 1

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top