function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shwetal DesaiShwetal Desai 

How can i insert Date and DateTime values from .NET to Sforce?

Hi ,

In my sForce Object i have two fields A(Date) and B(DateTime),

now i need to insert values from .NET C# application ...

but if i apply values directly like

sObject__c myObj = (sObject__c)qr.records[i];
myObj.A = DateTime.Parse(txtDate.Text).Date;
myObj.B = DateTime.Parse(txtDateTime.Text);

Then its not inserting values in these fields in sforce..... it remains with null values

how can i insert Date and DateTime values in sforce from .NET C#??

Please Help

See the sticky at the top of forum "why is my date/bool/number ....."
Mike LeachMike Leach
For Salesforce Date fields, format the .NET native DateTime object using the following:



For Salesforce DateTime fields, format .NET DateTime using the following: