Alan,
That's weird. I can't get it to work and have exactly the problem identified 
here:

http://support.microsoft.com/kb/321631

and Steve, you are correct. Dates in VFP are a law unto themselves compared 
with the now Standard DateTime type in C# and I ended up converting to string 
format using dtoc(<<date>>,1) which works fine.

Still can't understand why Alan's works though!

Dave


-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Alan Bourke
Sent: 23 October 2012 12:51
To: [email protected]
Subject: Re: VFP OOLEDB/ODBC parameters problem



On Tue, Oct 23, 2012, at 12:05 PM, Dave Crozier wrote:
> Oh, and just a reminder to anyone embarking on a similar quest that 
> OLEDB can only accept CHARACTER parameters

Are you sure? This works fine for me:

            using (OleDbConnection operaConnection = new
            OleDbConnection(targetCompany.DataConnectionString))
            {
                operaConnection.Open();
                OleDbCommand operaCommand = new
                OleDbCommand(@"pgfnpgisnsetnew(?,?,?)",
                operaConnection);

                // -- Start a transactable update.
                OleDbTransaction operaTxn =
                operaConnection.BeginTransaction();
                operaCommand.Transaction = operaTxn;
                operaCommand.Parameters.Add("@lcAccount",
                OleDbType.VarChar, 8);
                operaCommand.Parameters.Add("@ltStamp",
                OleDbType.DBTimeStamp);
                operaCommand.Parameters.Add("@lcUsername",
                OleDbType.VarChar, 100);

                foreach (Customer ThisCustomer in updateCustomers.items)
                {
                    operaCommand.Parameters["@lcAccount"].Value =
                    ThisCustomer.accountcode;
                    operaCommand.Parameters["@ltStamp"].Value =
                    System.DateTime.Now;
                    operaCommand.Parameters["@lcUsername"].Value =
                    ThisCustomer.servoyusername;

<snip>


--
  Alan Bourke
  alanpbourke (at) fastmail (dot) fm


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to