Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 29th, 2006, 10:41 AM
Registered User
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default GridView + timestamp

I have a follow store provedure whit a type data(timestamp):

ALTER PROCEDURE [dbo].[ProveedoresUpd]

(

@ProveedorId int,

@Nombre varchar(150),

@Borrado bit,

@Version timestamp

)

AS

SET NOCOUNT OFF;

UPDATE [ActivosFijos].[Proveedores] SET [Nombre] = @Nombre, [Borrado] = @Borrado

WHERE (([ProveedorId] = @ProveedorId) AND ([Version] = @Version));



In Asp.Net I have a gridview with a sql datasource, this is te code:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="prov.aspx.vb" Inherits="prov" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>P gina sin t¡tulo</title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"

AutoGenerateColumns="False" DataKeyNames="ProveedorId" DataSourceID="SqlDataSource1">

<Columns>

<asp:CommandField ShowEditButton="True" ShowSelectButton="True" />

<asp:BoundField DataField="ProveedorId" HeaderText="ProveedorId" InsertVisible="False"

ReadOnly="True" SortExpression="ProveedorId" />

<asp:BoundField DataField="Nombre" HeaderText="Nombre" SortExpression="Nombre" />

<asp:CheckBoxField DataField="Borrado" HeaderText="Borrado" SortExpression="Borrado" />

</Columns>

</asp:GridView>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SiovConnectionString %>"

DeleteCommand="ProveedoresDel" DeleteCommandType="StoredProcedure" InsertCommand="ProveedoresIns"

InsertCommandType="StoredProcedure" SelectCommand="ProveedoresSel" SelectCommandType="StoredProcedure"

UpdateCommand="ProveedoresUpd" UpdateCommandType="StoredProcedure">

<DeleteParameters>

<asp:Parameter Name="Original_ProveedorId" Type="Int32" />

<asp:Parameter Name="Original_Version" Type="Object" />

</DeleteParameters>

<UpdateParameters>

<asp:Parameter Name="ProveedorId" Type="Int32" />

<asp:Parameter Name="Nombre" Type="String" />

<asp:Parameter Name="Borrado" Type="Boolean" />

<asp:Parameter Name="Version" Type="DateTime" />

</UpdateParameters>

<InsertParameters>

<asp:Parameter Name="Nombre" Type="String" />

<asp:Parameter Name="Borrado" Type="Boolean" />

</InsertParameters>

</asp:SqlDataSource>


</div>

</form>

</body>

</html>



But, I need update a row the colum Version is nothing or null, so What I can do?







Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeStamp nay_ctg BOOK: Beginning Cryptography with Java 1 August 7th, 2008 07:37 PM
Timestamp Problem hernann Java Databases 5 September 26th, 2007 07:51 AM
GridView + timestamp victorsj ASP.NET Espanol 0 August 29th, 2006 10:43 AM
timestamp isheikh BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 November 18th, 2004 06:23 PM
Timestamp and sql nevada city J2EE 3 June 24th, 2003 11:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.