locked
Fields numeric all 0 - updated RRS feed

  • Question

  • User-909867351 posted

    update

    The problem seems to be with the size of the fields. If I define one field as Text got the problem listed bellow (all numeric fields became 0) but If I define the field as Varchar (3000) for instance works fine.

    If I connect localhost to my online database everything works fine, on my website not.

    Hi

    I have one gridview connected to a sqlDataSource. If I use one session variable as show below all my numeric fields turns to 0. I have one field id with the option autoincrement and the result is 0 too. I'm working with one MysqlDatabase

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="select * from fracoes where edificio=? ">           
            <SelectParameters>
                    <asp:SessionParameter Name="?" SessionField="edificio" />
                </SelectParameters>     
            </asp:SqlDataSource>

    If I don't use the session variable to filter my results all works fine. 

    The problem is not wit session variable because if I filter for other parameter like 

     <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="select * from fracoes where edificio=?">           
            <SelectParameters>
                    <asp:ControlParameter ControlID="HiddenField2" Name="?" PropertyName="Value" />
                </SelectParameters>     
            </asp:SqlDataSource>

    the problem is the same

    What happened in localhost works fine.

    Saturday, December 7, 2019 6:13 PM

Answers

  • User-719153870 posted

    Hi mariolopes,

    mariolopes

    If I define the field as Varchar (3000) for instance works fine.

    Yes, The text datatype is deprecated you can see it from ntext, text, and image (Transact-SQL) and SQL Server Text type vs. varchar data type.

    mariolopes

    If I connect localhost to my online database everything works fine, on my website not.

    According to this description, the problem is not clear. What do you mean by "on my wesite not"? Did you get any error?

    Or it might be your website can not connect to the online database correctly. The connection string could be wrong.

    Press F12 and use the devtool to check if you got any error message, provide the message and see if we can help.

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 9, 2019 2:48 AM

All replies

  • User-719153870 posted

    Hi mariolopes,

    mariolopes

    If I define the field as Varchar (3000) for instance works fine.

    Yes, The text datatype is deprecated you can see it from ntext, text, and image (Transact-SQL) and SQL Server Text type vs. varchar data type.

    mariolopes

    If I connect localhost to my online database everything works fine, on my website not.

    According to this description, the problem is not clear. What do you mean by "on my wesite not"? Did you get any error?

    Or it might be your website can not connect to the online database correctly. The connection string could be wrong.

    Press F12 and use the devtool to check if you got any error message, provide the message and see if we can help.

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 9, 2019 2:48 AM
  • User-1340885213 posted

    If I connect localhost to my online database everything works fine, on my website not.

    I guess, your web server needs proper version update. That is why, it is working in localhost, but does not work in the remote server. You may get a talk with your domain host.

    Monday, December 9, 2019 4:47 AM