none
DefaultValue = TextBoxCodigo.Text RRS feed

  • Pergunta

  • Eu tenho um valor que eu recupero na minha pagina.aspx.cs num TexBoxCodigo.Text

    Como inserir esse TextBoxCodigo no meu SqlDataSource no meu DefaultValue que esta logo abaixo ?

     <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:connectionString %>"
            DeleteCommand="DELETE FROM [AREASUBAREA] WHERE [CODIGO] = @CODIGO"
            InsertCommand="INSERT INTO [AREASUBAREA] ([CODAREA], [DESCAREA], [CODSUB], [DESCSUB], [CC], [DATE], [USERNAME]) VALUES (upper(@CODAREA), upper(@DESCAREA), upper(@CODSUB), upper(@DESCSUB), upper(@CC), @DATE, upper(@USERNAME))"
            SelectCommand="SELECT * FROM [AREASUBAREA] WHERE ([CODIGO] = @CODIGO)"
            UpdateCommand="UPDATE [AREASUBAREA] SET [CODAREA] = upper(@CODAREA), [DESCAREA] = upper(@DESCAREA), [CODSUB] = upper(@CODSUB), [DESCSUB] = upper(@DESCSUB), [CC] = upper(@CC), [DATE] = @DATE, [USERNAME] = upper(@USERNAME) WHERE [CODIGO] = @CODIGO">
            <SelectParameters>
                <asp:ControlParameter ControlID="GridView1"  Name="CODIGO"
                        PropertyName="SelectedValue" Type="String" DefaultValue=""/>
            </SelectParameters>        
            <DeleteParameters>
                <asp:Parameter Name="CODIGO" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="CODIGO" Type="String" />
                <asp:Parameter Name="CODAREA" Type="String" />
                <asp:Parameter Name="DESCAREA" Type="String" />
                <asp:Parameter Name="CODSUB" Type="String" />
                <asp:Parameter Name="DESCSUB" Type="String" />
                <asp:Parameter Name="CC" Type="String" />
                <asp:Parameter Name="DATE" Type="DateTime" />
                <asp:Parameter Name="USERNAME" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="CODIGO" Type="String" />
                <asp:Parameter Name="CODAREA" Type="String" />
                <asp:Parameter Name="DESCAREA" Type="String" />
                <asp:Parameter Name="CODSUB" Type="String" />
                <asp:Parameter Name="DESCSUB" Type="String" />
                <asp:Parameter Name="CC" Type="String" />
                <asp:Parameter Name="DATE" Type="DateTime" />
                <asp:Parameter Name="USERNAME" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>

    Alguem pode me ajudar ?

    Aguardo Retorno.

    segunda-feira, 2 de julho de 2012 11:41

Respostas

Todas as Respostas