I’m just started using vb.net.The program is about replication.I need some help in the coding below.
SQL =
"INSERT INTO b_CODATxn(sIC,sSemester,sSeqNo,iTxnLineID,iLineID,dTxnDate,sTxnType,sAccNo, iDrCrInd,mAmt,sDesc,sFeeCode,iRecur,dProcessDate," + _ " iID,sModFlag,sPostUser, iPeriod,iYear,mAmtPart ,sDepositSlip,sDoccode,sDocnum,sPayMode,sLinkcode,sComments,iLinkRunNo,iJournal,dDocDate) VALUES " + _ "('" + myarray(i, 0) + "','" + myarray(i, 1) + "','" + myarray(i, 2) + "','" + myarray(i, 3) + "','" + myarray(i, 4) + _ "','" + myarray(i, 5) + "','" + myarray(i, 6) + "','" + myarray(i, 7) + "','" + myarray(i, 8) + "','" + myarray(i, 9) + _ "','" + myarray(i, 10) + "','" + myarray(i, 11) + "','" + myarray(i, 12) + "','" + myarray(i, 13) + "','" + myarray(i, 14) + _ "','" + myarray(i, 15) + "','" + myarray(i, 16) + "','" + myarray(i, 17) + "','" + myarray(i, 18) + "','" + myarray(i, 19) + _ "','" + myarray(i, 20) + "','" + myarray(i, 21) + "','" + myarray(i, 22) + "','" + myarray(i, 23) + "','" + myarray(i, 24) + _ "','" + myarray(i, 25) + "','" + myarray(i, 26) + "','" + myarray(i, 27) + "','" + myarray(i, 28) + "')"
After the execution this error will appear!!!
System.data.OdbcException:ERROR[22018][ODBC Sybase Wire Protocol driver][SQL Server]Implicit conversion from datatype 'VARCHAR' to 'INT' is not allowed.Use the CONVERT function to run this query.
ERROR[22018][ODBC Sybase Wire Protocol driver][SQL Server]Implicit conversion from datatype 'VARCHAR' to 'SMALLINT' is not allowed.Use the CONVERT function to run this query.
ERROR[22018][ODBC Sybase Wire Protocol driver][SQL Server]Implicit conversion from datatype 'VARCHAR' to 'NUMERIC' is not allowed.Use the CONVERT function to run this query.
ERROR[22018][ODBC Sybase Wire Protocol driver][SQL Server]Implicit conversion from datatype 'VARCHAR' to 'MONEY' is not allowed.Use the CONVERT function to run this query.
ERROR[22018][ODBC Sybase Wire Protocol driver][SQL Server]Arithmetic overflow during implicit conversion of VARCHAR value '13/03/2008' to a DATETIME field.
yana samPosted Apr 16, 2008, 10:13 PM
The first error which been posted does not appear anymore because i've correct them already but then this new erroe occurs.:-
PROCESS FAIL !!!System.Data.Odbc.OdbcException : ERROR [22003][DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Arithmetic overflow during implicit conversion of VARCHAR value ‘13/03/2008’ to a DATETIME field .
Hope you can help..
Thanks..
yana samPosted Apr 16, 2008, 9:55 PM
Vijaya KadiyalaPosted Apr 15, 2008, 6:51 PM
Hi,
myarray --> can u also post this rray delcaration. and also post the values that your passing.
Thanks -- Vj
yana samPosted Apr 15, 2008, 12:26 AM
here is the table structure...
create table b_CODATxn (
sIC varchar(20) null ,
sSemester varchar(3) null ,
sSeqNo varchar(20) null ,
iTxnLineID int null ,
iLineID int null ,
dTxnDate datetime null ,
sTxnType varchar(20) null ,
sAccNo varchar(72) null ,
iDrCrInd int null ,
mAmt money null ,
sDesc varchar(50) null ,
sFeeCode varchar(50) null ,
iRecur int null ,
dProcessDate datetime null ,
iID numeric(18,0) identity ,
sModFlag varchar(5) null ,
sPostUser varchar(20) null ,
iPeriod smallint null ,
iYear smallint null ,
mAmtPart money null ,
sDepositSlip varchar(20) null ,
sDoccode varchar(12) null ,
sDocnum varchar(12) null ,
sPayMode varchar(20) null ,
sLinkcode varchar(12) null ,
sComments varchar(255) null ,
iLinkRunNo numeric(18,0) null ,
iJournal smallint DEFAULT 0 null ,
dDocDate smalldatetime null
)
Vijaya KadiyalaPosted Apr 9, 2008, 4:00 PM
Hi,
can u post the Table strucure with the data type and the values that are passing in the insert statements. It looks like the values data types that you are passing doens't match with the table columns data types.
Thanks -- Vj
http://dotnetvj.blogspot.com