Only first character of text inserting into DB

Discussion in 'ASP .Net' started by bmayer@mnepilepsy.net, Aug 29, 2006.

  1. Guest

    I am using a SqlDataSource to put data into a database from three
    TextBoxes.

    The problem is that only the first character from the TextBoxes is
    being inserted into the database.

    The code:

    <InsertParameters>
    <asp:ControlParameter ControlID="TextBox2" Name="Text1"
    Type="String" />
    <asp:ControlParameter ControlID="TextBox3" Name="Text2"
    Type="String" />
    <asp:ControlParameter ControlID="TextBox4" Name="Text3"
    Type="String" />
    </InsertParameters>


    The schema:

    UID int
    Text1 nvarchar(4000)
    Text2 nvarchar(4000)
    Text3 nvarchar(4000)

    UID is a primary key, and auto-increments.

    Any ideas?
     
    , Aug 29, 2006
    #1
    1. Advertisements

  2. Where is the SQL? It sounds like your SQLparameter doesn't have a length set.
    Peter

    --
    Co-founder, Eggheadcafe.com developer portal:
    http://www.eggheadcafe.com
    UnBlog:
    http://petesbloggerama.blogspot.com




    "" wrote:

    > I am using a SqlDataSource to put data into a database from three
    > TextBoxes.
    >
    > The problem is that only the first character from the TextBoxes is
    > being inserted into the database.
    >
    > The code:
    >
    > <InsertParameters>
    > <asp:ControlParameter ControlID="TextBox2" Name="Text1"
    > Type="String" />
    > <asp:ControlParameter ControlID="TextBox3" Name="Text2"
    > Type="String" />
    > <asp:ControlParameter ControlID="TextBox4" Name="Text3"
    > Type="String" />
    > </InsertParameters>
    >
    >
    > The schema:
    >
    > UID int
    > Text1 nvarchar(4000)
    > Text2 nvarchar(4000)
    > Text3 nvarchar(4000)
    >
    > UID is a primary key, and auto-increments.
    >
    > Any ideas?
    >
    >
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Aug 29, 2006
    #2
    1. Advertisements

  3. Guest

    Ah thank you!

    The stored procedure was using chars instead of nvarchars.

    Peter wrote:
    > Where is the SQL? It sounds like your SQLparameter doesn't have a length set.
    > Peter
    >


    > >
    > > Any ideas?
    > >
    > >
     
    , Aug 29, 2006
    #3
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jurjen de Groot

    Inserting text into TableCell at runtime

    Jurjen de Groot, Aug 18, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    627
    Xavier MT
    Aug 18, 2003
  2. Ceri
    Replies:
    2
    Views:
    527
    Ceri Locke
    Dec 17, 2003
  3. =?Utf-8?B?Um9iZXJ0IEhhbHN0ZWFk?=

    Problem with text when inserting into text box

    =?Utf-8?B?Um9iZXJ0IEhhbHN0ZWFk?=, Apr 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    543
    Somchai U.
    Apr 27, 2004
  4. =?Utf-8?B?ZGVlcGFrIGt1bWFy?=

    inserting html dropdownlist 's text into blank table

    =?Utf-8?B?ZGVlcGFrIGt1bWFy?=, Nov 2, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    718
    =?Utf-8?B?ZGVlcGFrIGt1bWFy?=
    Nov 2, 2004
  5. Replies:
    0
    Views:
    494
  6. thersitz
    Replies:
    3
    Views:
    812
    thersitz
    Jan 31, 2007
  7. Disc Magnet
    Replies:
    2
    Views:
    934
    Jukka K. Korpela
    May 15, 2010
  8. Disc Magnet
    Replies:
    2
    Views:
    996
    Neredbojias
    May 14, 2010
Loading...