1、Below is my datasource (orderDate is date)
<DataSource
ID="queuedAdd_order"
serverType="sql"
tableName="queuedOrder" testFileName="/examples/shared/ds/serverExamples/test_data/queuedOrder.data.xml"
>
<fields>
<field name="orderID" type="sequence" primaryKey="true" hidden="true" />
<field name="customerName" type="text" />
<field name="orderDate" type="date" />
<field name="shippingCost" type="float" />
</fields></DataSource>
2、Bind data with dform
isc.DynamicForm.create({
ID: "orderForm",
autoDraw: false,
dataSource: queuedAdd_order,
useAllDataSourceFields: true
});
3、produce a xml from dForm and transmit to sql server 2005
'<items><item><orderDate>Fri Apr 30 2010 00:00:00 GMT+0800</orderDate>
<customerName>test001</customerName><shippingCost>111</shippingCost></item></items>'
4、database
declare @fields xml
set @fields='<items><item><orderDate>Fri Apr 30 2010 00:00:00 GMT+0800</orderDate>
<customerName>test001</customerName><shippingCost>111</shippingCost></item></items>'
select @fields
SELECT
ParamValues.ID.query('customerName').value('.','VARCHAR(50)') as customerName,
ParamValues.ID.query('orderDate').value('.','datetime') as orderDate,
ParamValues.ID.query('shippingCost').value('.','VARCHAR(20)') as shippingCost
FROM @fields.nodes('/items/item') as ParamValues(ID);
5、My Problen is that in the step 4, orderDate can not convert to datetime
So, I want to ask how to select ‘orderDate’ as type of datetime