C
cj
I've got a long string to be written to a field in a sql db table via
stored procedure. For some reason I find only 258 chars are being
written. Any ideas?
relevant bits of my VB2005 code:
mySqlConnection.ConnectionString = "..........
mySqlCommand.Connection = mySqlConnection
mySqlCommand.CommandType = CommandType.StoredProcedure
myRspSqlCommand.Connection = mySqlConnection
myRspSqlCommand.CommandType = CommandType.StoredProcedure
myRspSqlCommand.CommandText = "write_resp"
myRspSqlCommand.Parameters.Clear()
myRspSqlCommand.Parameters.Add(New
SqlClient.SqlParameter("@mCODE", Data.SqlDbType.Char, 3))
myRspSqlCommand.Parameters.Add(New
SqlClient.SqlParameter("@mDATA", Data.SqlDbType.Char, 1000))
myRspSqlCommand.Parameters.Add(New
SqlClient.SqlParameter("@mUID", Data.SqlDbType.Char, 6))
..
..
..
myRspSqlCommand.Parameters("@mCODE").Value = RTcode
myRspSqlCommand.Parameters("@mDATA").Value = RTrespstr
myRspSqlCommand.Parameters("@mUID").Value = RTuid
myRspSqlCommand.ExecuteNonQuery()
The stored procedure (which I didn't write)
-- Parameters CODE,DATA,UID
CREATE PROCEDURE [dbo].[write_resp] @mCODE char(3),@mDATA
char(1000),@mUID char(6) AS
set nocount on
insert into vresp (code,data,uid) values(@mCODE,@mDATA,@mUID )
GO
the database structure is table structure shows data as being type char
and 1000 in length.
stored procedure. For some reason I find only 258 chars are being
written. Any ideas?
relevant bits of my VB2005 code:
mySqlConnection.ConnectionString = "..........
mySqlCommand.Connection = mySqlConnection
mySqlCommand.CommandType = CommandType.StoredProcedure
myRspSqlCommand.Connection = mySqlConnection
myRspSqlCommand.CommandType = CommandType.StoredProcedure
myRspSqlCommand.CommandText = "write_resp"
myRspSqlCommand.Parameters.Clear()
myRspSqlCommand.Parameters.Add(New
SqlClient.SqlParameter("@mCODE", Data.SqlDbType.Char, 3))
myRspSqlCommand.Parameters.Add(New
SqlClient.SqlParameter("@mDATA", Data.SqlDbType.Char, 1000))
myRspSqlCommand.Parameters.Add(New
SqlClient.SqlParameter("@mUID", Data.SqlDbType.Char, 6))
..
..
..
myRspSqlCommand.Parameters("@mCODE").Value = RTcode
myRspSqlCommand.Parameters("@mDATA").Value = RTrespstr
myRspSqlCommand.Parameters("@mUID").Value = RTuid
myRspSqlCommand.ExecuteNonQuery()
The stored procedure (which I didn't write)
-- Parameters CODE,DATA,UID
CREATE PROCEDURE [dbo].[write_resp] @mCODE char(3),@mDATA
char(1000),@mUID char(6) AS
set nocount on
insert into vresp (code,data,uid) values(@mCODE,@mDATA,@mUID )
GO
the database structure is table structure shows data as being type char
and 1000 in length.