Wednesday, March 7, 2012

Error connecting to datasource using bulk load

thanks for getting back to me. I am able to connect to the database
elsewhere in the application to call stored procedures and retrieve the
data to display. This is the only place within the application that I am
unable to connect. I suspect it has to do with the fact that I am
calling within a single thread. Here is the connect string:
"Data Source=(local);Initial Catalog=IOC;User
ID=sg2user;password=sg2user"
franksag
Posted via http://www.codecomments.com
Try setting the Provider=sqloledb value in the connection string. Here's an
example from our docs of Bulkload in .NET:
[STAThread]
static void Main(string[] args)
{
try
{
SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class objBL = new
SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class();
objBL.ConnectionString =
"Provider=sqloledb;server=server;database=database Name;integrated
security=SSPI";
objBL.ErrorLogFile = "error.xml";
objBL.KeepIdentity = false;
objBL.Execute ("schema.xml","data.xml");
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}
}
"franksag" <franksag.1llvtp@.mail.codecomments.com> wrote in message
news:franksag.1llvtp@.mail.codecomments.com...
> thanks for getting back to me. I am able to connect to the database
> elsewhere in the application to call stored procedures and retrieve the
> data to display. This is the only place within the application that I am
> unable to connect. I suspect it has to do with the fact that I am
> calling within a single thread. Here is the connect string:
> "Data Source=(local);Initial Catalog=IOC;User
> ID=sg2user;password=sg2user"
>
> --
> franksag
> Posted via http://www.codecomments.com
>

No comments:

Post a Comment