A
aitor.diazdealda
I am in a very deep hole and i can not see the light .
Here my mistake if you could help me.
store procedure.-> they work ok.
ALTER PROCEDURE dbo.UpdateEtiClientesEtidora
(
@CLI_COD_PLAZA nvarchar(3),
@CLI_COD_CLI nvarchar(9),
@ETIDORA_COD_ANT int,
@ETIDORA_COD_NEW int,
@NUMERO int)
AS
SET NOCOUNT ON;
UPDATE EtiClientes SET CLI_COD_PLAZA=@CLI_COD_PLAZA,
CLI_COD_CLI=@CLI_COD_CLI,ETIDORA_COD=@ETIDORA_COD_NEW,NUMERO=@NUMERO
WHERE ([CLI_COD_CLI] = @CLI_COD_CLI) and
([CLI_COD_PLAZA]=@CLI_COD_PLAZA) and ([ETIDORA_COD]=@ETIDORA_COD_ANT)
ALTER PROCEDURE dbo.DeleteEtiCustomerEtidora
(
@CLI_COD_CLI int,
@CLI_COD_PLAZA int,
@ETIDORA_COD int)
AS
SET NOCOUNT ON;
DELETE FROM EtiClientes WHERE ([CLI_COD_CLI] = @CLI_COD_CLI) and
([CLI_COD_PLAZA]=@CLI_COD_PLAZA) and
([ETIDORA_COD]=@ETIDORA_COD)
El siguiente codigo.
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False"
DataSourceID="ObjectDataSource1">
<Columns>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:ImageButton ID="ImageButton4" runat="server"
CausesValidation="True"
CommandName="Update" ImageUrl="~/img/bg.gif"
OnClientClick="Button4_Click"
/>
<asp:ImageButton ID="ImageButton5" runat="server"
CausesValidation="False"
CommandName="Cancel" ImageUrl="~/img/no.gif"
OnClientClick="Button5_Click"
/>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/img/
Edit.gif"
OnClientClick="Button1_Click" commandname="Edit"/>
<asp:ImageButton ID="ImageButton2" runat="server" CommandName="select"
ImageUrl="~/img/detalle.gif" OnClientClick="button2_click" />
<asp:ImageButton ID="ImageButton3" runat="server"
ImageUrl="~/img/Delete.gif" OnClientClick="button3_click"
CommandName="delete" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente" SortExpression="CLI_COD_CLI">
<EditItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%#
Eval("CLI_COD_CLI")
%>' Width="48px"></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("CLI_COD_CLI")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Numero" SortExpression="Numero">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" MaxLength="2" Text='<%#
Bind("Numero") %>'
Width="32px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Numero")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Modelo"
SortExpression="ETIDORA_NOMBRE">
<EditItemTemplate>
<aspropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource1"
DataTextField="ETIDORA_NOMBRE" DataValueField="ETIDORA_NOMBRE"
Width="128px"
SelectedValue='<%# Bind("ETIDORA_NOMBRE") %>'>
</aspropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString2 %>"
SelectCommand="SELECT [ETIDORA_NOMBRE] FROM [ETIDORAS]"></
asp:SqlDataSource>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("ETIDORA_NOMBRE")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
OldValuesParameterFormatString="{0}"
SelectMethod="GetEtiClientesEtidora"
TypeName="DsEtidoraTableAdapters.EtiClientesEtidoraTableAdapter"
DeleteMethod="DeleteEtiClientesEtidora"
UpdateMethod="UpdateEtiClientesEtidora"
InsertMethod="InsertEtiClientesEtidora">
<DeleteParameters>
<asparameter Name="CLI_COD_PLAZA" Type="String" />
<asparameter Name="CLI_COD_CLI" Type="String" />
<asparameter Name="ETIDORA_COD" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asparameter Name="CLI_COD_PLAZA" Type="String" />
<asparameter Name="CLI_COD_CLI" Type="String" />
<asparameter Name="ETIDORA_COD_NEW" Type="Int32" />
<asparameter Name="NUMERO" Type="Int32" />
<asparameter Name="ETIDORA_COD_ANT" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asparameter Name="CLI_COD_PLAZA" Type="String" />
<asparameter Name="CLI_COD_CLI" Type="String" />
<asparameter Name="ETIDORA_COD" Type="Int32" />
<asparameter Name="NUMERO" Type="Int32" />
</InsertParameters>
<SelectParameters>
</SelectParameters>
</asp:ObjectDataSource>
Here my mistake if you could help me.
store procedure.-> they work ok.
ALTER PROCEDURE dbo.UpdateEtiClientesEtidora
(
@CLI_COD_PLAZA nvarchar(3),
@CLI_COD_CLI nvarchar(9),
@ETIDORA_COD_ANT int,
@ETIDORA_COD_NEW int,
@NUMERO int)
AS
SET NOCOUNT ON;
UPDATE EtiClientes SET CLI_COD_PLAZA=@CLI_COD_PLAZA,
CLI_COD_CLI=@CLI_COD_CLI,ETIDORA_COD=@ETIDORA_COD_NEW,NUMERO=@NUMERO
WHERE ([CLI_COD_CLI] = @CLI_COD_CLI) and
([CLI_COD_PLAZA]=@CLI_COD_PLAZA) and ([ETIDORA_COD]=@ETIDORA_COD_ANT)
ALTER PROCEDURE dbo.DeleteEtiCustomerEtidora
(
@CLI_COD_CLI int,
@CLI_COD_PLAZA int,
@ETIDORA_COD int)
AS
SET NOCOUNT ON;
DELETE FROM EtiClientes WHERE ([CLI_COD_CLI] = @CLI_COD_CLI) and
([CLI_COD_PLAZA]=@CLI_COD_PLAZA) and
([ETIDORA_COD]=@ETIDORA_COD)
El siguiente codigo.
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False"
DataSourceID="ObjectDataSource1">
<Columns>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:ImageButton ID="ImageButton4" runat="server"
CausesValidation="True"
CommandName="Update" ImageUrl="~/img/bg.gif"
OnClientClick="Button4_Click"
/>
<asp:ImageButton ID="ImageButton5" runat="server"
CausesValidation="False"
CommandName="Cancel" ImageUrl="~/img/no.gif"
OnClientClick="Button5_Click"
/>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/img/
Edit.gif"
OnClientClick="Button1_Click" commandname="Edit"/>
<asp:ImageButton ID="ImageButton2" runat="server" CommandName="select"
ImageUrl="~/img/detalle.gif" OnClientClick="button2_click" />
<asp:ImageButton ID="ImageButton3" runat="server"
ImageUrl="~/img/Delete.gif" OnClientClick="button3_click"
CommandName="delete" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cliente" SortExpression="CLI_COD_CLI">
<EditItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%#
Eval("CLI_COD_CLI")
%>' Width="48px"></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("CLI_COD_CLI")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Numero" SortExpression="Numero">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" MaxLength="2" Text='<%#
Bind("Numero") %>'
Width="32px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Numero")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Modelo"
SortExpression="ETIDORA_NOMBRE">
<EditItemTemplate>
<aspropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource1"
DataTextField="ETIDORA_NOMBRE" DataValueField="ETIDORA_NOMBRE"
Width="128px"
SelectedValue='<%# Bind("ETIDORA_NOMBRE") %>'>
</aspropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString2 %>"
SelectCommand="SELECT [ETIDORA_NOMBRE] FROM [ETIDORAS]"></
asp:SqlDataSource>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("ETIDORA_NOMBRE")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
OldValuesParameterFormatString="{0}"
SelectMethod="GetEtiClientesEtidora"
TypeName="DsEtidoraTableAdapters.EtiClientesEtidoraTableAdapter"
DeleteMethod="DeleteEtiClientesEtidora"
UpdateMethod="UpdateEtiClientesEtidora"
InsertMethod="InsertEtiClientesEtidora">
<DeleteParameters>
<asparameter Name="CLI_COD_PLAZA" Type="String" />
<asparameter Name="CLI_COD_CLI" Type="String" />
<asparameter Name="ETIDORA_COD" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asparameter Name="CLI_COD_PLAZA" Type="String" />
<asparameter Name="CLI_COD_CLI" Type="String" />
<asparameter Name="ETIDORA_COD_NEW" Type="Int32" />
<asparameter Name="NUMERO" Type="Int32" />
<asparameter Name="ETIDORA_COD_ANT" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asparameter Name="CLI_COD_PLAZA" Type="String" />
<asparameter Name="CLI_COD_CLI" Type="String" />
<asparameter Name="ETIDORA_COD" Type="Int32" />
<asparameter Name="NUMERO" Type="Int32" />
</InsertParameters>
<SelectParameters>
</SelectParameters>
</asp:ObjectDataSource>