string will be truncated by tableadapter insert command ??!!

Has anybody an idea to the following problem:

When i send an insert over the TableAdapter then my strings will be
truncated. Here is the following code

Products: Visual Basic 2005 Express, SQL Server 2005 Express

Dim LPTA As New BSC.BSCDataSetTableAdapters.LoginProtokollTableAdapter

LPTA.Insert(Login, "123456789123456789", "123456789123456789")

The datas in the Database Tables are then truncated to 10 characters e.g.

1234567891

When i do the query manually to the database then there is no problem e.g.

INSERT INTO LoginProtokoll
(Login, Workstation, IPAdress)
VALUES ('Testuser','123456789123456789','123456789123456789')

Manually the strings are completed! So there must be a problem in transfering
the string by the TableAdapter Insert Command ! Has anybody an idea
to handle this problem

thx Gear



Answer this question

string will be truncated by tableadapter insert command ??!!

  • Martin Fierz

    check the table adapters column definition and make sure that you don't have the data type limited to size ie Char(10)

  • Sudhir

    yes, i did! Otherwise it would not be possible to run the commany manually;)

    So the the data type is not limited to size Char(10) => nchar(25)


  • cvwilletts

    I found a solution to that problem!

    The problem occured because the database structure was changed after

    I have created the dataset and the table adapter.

    So I deleted the Dataset and its relationships and builded the same new.
    Now i works! Strange, but it is a work around!

    Gear


  • string will be truncated by tableadapter insert command ??!!