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. Advertising

  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. Advertising

  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. Advertising

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. =?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:
    397
    Somchai U.
    Apr 27, 2004
  2. Replies:
    0
    Views:
    423
  3. thersitz
    Replies:
    3
    Views:
    629
    thersitz
    Jan 31, 2007
  4. Disc Magnet
    Replies:
    2
    Views:
    698
    Jukka K. Korpela
    May 15, 2010
  5. Disc Magnet
    Replies:
    2
    Views:
    781
    Neredbojias
    May 14, 2010
Loading...

Share This Page