bulkCopy.BatchSize = 1000;
bulkCopy.BulkCopyTimeout = 30;
bulkCopy.NotifyAfter = 1000;
bulkCopy.DestinationTableName = "CuotaAtrasada";
bulkCopy.WriteToServer(tableOfData);
The entire XML file was loaded into dataset and all fields are
System.String type
The source XML and the target table named "CuotaAtrasada" has the same
number, order and name of columns. This table has no primary key.
Following the table structure:
Database Options
select into/bulkcopy/pllsort, trunc log on chkpt
table structure
Create Table CuotaAtrasada
(
TipoPersona varchar(30) NULL
,IdDeudor varchar(30) NULL
,IdOperacion varchar(30) NULL
,TipoCuota varchar(30) NULL
,NumCuotaAtrasada varchar(30) NULL
,DiasAtraso varchar(30) NULL
,MontoCuotaAtrasada varchar(30) NULL
,id varchar(30) NULL
,accion varchar(30) NULL
,Datos_Id varchar(30) NULL
)
I think this message is coming from something else, not the ASE since the
types indicated are ADO.NET types - Do you have a try / catch block in here
and
possibly add PrintStackTrace to this - it would give a good idea of where
this
is failing.
The error could have more to do with improper setting of a value to a
property
rather than something related to the XML data. Does it occur in the
beginning?
Do any records get inserted? Or does nothing happen in that regard?
Example:
try
{
//Bulk Copy code - like what you have below
bulkCopy.BatchSize = 1000;
bulkCopy.BulkCopyTimeout = 30;
bulkCopy.NotifyAfter = 1000;
bulkCopy.DestinationTableName = "CuotaAtrasada";
bulkCopy.WriteToServer(tableOfData);
}
catch (AseException asex)
{
Console.WriteLine("AseException: " + asex);
//Might not be necessary as AseException can produce the stack
Console.WriteLine("Stack: " + asex.StackTrace);
}
-Paul
"Lespinoza" <luisespi...@gmail.com> wrote in message
news:fc670c93-d344-4a74...@d7g2000prl.googlegroups.com...
I think this message is coming from something else, not the ASE since the
types indicated are ADO.NET types - Do you have a try / catch block in here
and
possibly add PrintStackTrace to this - it would give a good idea of where
this
is failing.
The error could have more to do with improper setting of a value to a
property
rather than something related to the XML data. Does it occur in the
beginning?
Do any records get inserted? Or does nothing happen in that regard?
Example:
try
{
//Bulk Copy code - like what you have below
bulkCopy.BatchSize = 1000;
bulkCopy.BulkCopyTimeout = 30;
bulkCopy.NotifyAfter = 1000;
bulkCopy.DestinationTableName = "CuotaAtrasada";
bulkCopy.WriteToServer(tableOfData);
}
catch (AseException asex)
{
Console.WriteLine("AseException: " + asex);
//Might not be necessary as AseException can produce the stack
Console.WriteLine("Stack: " + asex.StackTrace);
}
-Paul
"Lespinoza" <luisespi...@gmail.com> wrote in message
news:fc670c93-d344-4a74...@d7g2000prl.googlegroups.com...
bulkCopy.WriteToServer(tableOfData);
run, no data are sending to server and the table keep empty.
No records was inserted and the exception return this
information
Message
"Unable to cast object of type 'System.Int16' to type
'System.String'." string
Source
"Sybase.AdoNet2.AseClient" string
StackTrace "
at
Sybase.Data.AseClient.AseBulkCopy.GenerateInsertCmd(DataTable
rowFmt)\r\n
at
Sybase.Data.AseClient.AseBulkCopy.PrepareMetaInfo(DataTable
clientTableFmt)\r\n
at Sybase.Data.AseClient.AseBulkCopy.WriteToServer(DataTable
table)\r\n
at DataHelper.SybaseHelper.BulkCopyData(String dataBase,
String tableName, DataTable tableOfData)
in C:\\Lespinoza\\My Source\\XML
Loader\\DataHelper\\SybaseHelper.cs:line 237" string
> > egroups.com... Hi all,
I think you need to open a tech support case - or could you provide the
whole
repro here so I can take a look at it?
I'm not sure how the source information is prepared.
-Paul
<Luis Espinoza> wrote in message news:4a412560.391...@sybase.com...
I think you need to open a tech support case - or could you provide the
whole
repro here so I can take a look at it?
I'm not sure how the source information is prepared.
-Paul
<Luis Espinoza> wrote in message news:4a412560.391...@sybase.com...
> Hi Luis,
>
> I think you need to open a tech support case - or could
> you provide the whole
> repro here so I can take a look at it?
>
> I'm not sure how the source information is prepared.
>
> -Paul
>
> <Luis Espinoza> wrote in message
> > news:4a412560.391...@sybase.com... Paul,
> > the error occur when the sentence
> >
> > bulkCopy.WriteToServer(tableOfData);
> >
> > run, no data are sending to server and the table keep
> > empty. No records was inserted and the exception return
> > this information
> >
> > Message
> > "Unable to cast object of type 'System.Int16' to type
> > 'System.String'." string
> >
> > Source
> > "Sybase.AdoNet2.AseClient" string
> >
> > StackTrace "
> > at
> >
> Sybase.Data.AseClient.AseBulkCopy.GenerateInsertCmd(DataTa
> > ble rowFmt)\r\n
> > at
> >
> Sybase.Data.AseClient.AseBulkCopy.PrepareMetaInfo(DataTabl
> > e clientTableFmt)\r\n
You can call Customer Service at 1-800-879-2273 (1-800-8SYBASE)
They should be able to start you through the process.
-Paul
<Luis Espinoza> wrote in message news:4a43d4a1.336...@sybase.com...