views:

603

answers:

2

I have all data in the code behind, and defined in xaml:

    <dds:DomainDataSource x:Name="ddsContAttachment" QueryName="GetMContAttachment" AutoLoad="True" LoadSize="20">
        <dds:DomainDataSource.DomainContext>
            <employee:ContractSrv />
        </dds:DomainDataSource.DomainContext>
        <dds:DomainDataSource.SortDescriptors>
            <filter:SortDescriptor PropertyPath="wContId" Direction="Ascending" />
            <filter:SortDescriptor PropertyPath="wSeqId" Direction="Ascending" />
        </dds:DomainDataSource.SortDescriptors>
    </dds:DomainDataSource>

As the title, How to insert a DB row without filing DataForm in code behind?

+2  A: 

In your code-behind, you should be able to do the following:

// get a new entity
var attachment = new Attachment();

// initialize attachment properties as needed
this.ddsContAttachment.DataView.Add(attachment);

// when ready to submit the new record...
this.ddsContAttachment.SubmitChanges();
Jeff Handley
A: 

excellent I was 3 heures searching in complexe page...and your answer is short and exact !!

Eduardo