Date Entity Validation

I have entered a validation rule for the an date type attribute and it's failing all the time even when I enter a valid date. Here's my validation rule:
Attribute: dueDate
Operator: LessOrEqualTo
Compare With: View Object Attribute
Select Attribute: lc.oracle.apps.ak.employee.server.employeeVO.latestduedate
Note that latestduedate is a calculated field.
I am getting the Error Message all the time even my date is less than the latestduedate
However, this works perferctly if I hardcode the calculation of latestduedate to to_date(sysdate, 'DD-MM-YYYY'). Any idea why?

Are you getting any error ?
what are the data types of dueDate and latestduedate ?
I think this is coming because of soem date format error, please let us know the details.
Thanks
Tapash

Similar Messages

  • How to stop attribute level validation when entity validator fails?

    Hi,
    Can you suggest any way to achieve the desired behaviour on the following scenario.
    Table contains the following columns
    1. Grade
    2. Grade Rate
    3. Status
    Constraints:
    1. Grade and Grade Rate together must be unique.
    2. Grade and Grade Rate are mandatory fields.
    Implementation:
    1. Have Mandatory validator at attribute level for Grade and Grade Rate by default.
    2. Alternate key is defined based on Grade and Grade Rate and added the same as Entity validator.
    User operation scenario:
    User adds a row in a table, entered 'GradeOne' as Grade, tabbed out and then entered '5 %' as Grade Rate (Existing row of the VO has a row with similar data already). When user try to navigate to other row, both validation at attribute level and entity level fires and gives the following error messages.
    Error Msg 1. Grade and GradeRate should be unique.
    Error Msg 2. Attribute GradeRate is required.
    Expected behaviour:
    I can understand the reason why ADF throws both the errors (coz it didn't consider the invalid value of GradeRate posted into attribute), but the error messages confuses the user. It would be great if he get only one error message in this scenario (i.e. Unique validation alone)
    Question:
    How can I restrict in such a way that only one error validation happens in a request (i.e. either attribute level or entity level or in a particular order}
    Thanks in Advance.

    Hi,
    the reason ADF does this is for performance. What if you create a custom error handler in the DataBindings.cpx file and use this to suppress all other errors?
    See
    Decompiling ADF Binaries: Customizing Business Components Error Messages
    :http://www.adftutorials.com/adf-custom-error-handler-to-display-custom-message-to-user.html
    Frank

  • MDG Cross entity validation using enrichment spot is not executed.

    I have configured the enrichment sport for cross entity validations and used BRF to validate the data, but looks like validations are
    not executed. I have the check activated for the step in the configuration and I can see my custom class is being picked in method GET_ENRICHMENTS of class CL_USMD_DQ_ACCESS_ENRICHMENT for that request type and step. I have flag relevant  selected and option “Execute Always” (will change this to “Execute when data changed).
    I am trying to figure out if SAP MDG standard code will execute my custom class code or not. I had put break point in my custom class constructor and this is called when an instance for enrichment is created in method GET_ENRICHMENTS of class CL_USMD_DQ_ACCESS_ENRICHMENT. However my code in below method is not executed (and hence BRF is not called)
      IF_USMD_ENRICHMENT_FEEDER~GET_ADAPTER_DATA
      IF_USMD_ENRICHMENT_FEEDER~IS_RELEVANT
    Now I am trying to figure out a place from where these enrichment class methods will be executed. I feel this will be from EXECUTE_ENRICHMENT
    of class CL_USMD_DQ_ACCESS_ENRICHMENT. But this method is also not executed when I hit on Check button. Am I looking wrong standard class?
    Is there anything I am missing in configuration? Or we need to implement any SAP note? I tried to find one, but no luck.

    Hello, I am not using cress entity BADI for Validation. I am using this BADI for cross entity derivations and they are working fine.
    I had a requirement to do cross entity validations, and I have rules written using the BRF+.
    I had used enrichment sport functionality to have a custom class used to call BRF functions and prepare the context with required entity data.
    Validations are supposed to happen based on the enrichment spot defined and the configuration for that enrichment sport on the process step level. This is not happening. let me know if you need more information on it,

  • HELP: ADF-Error in Entity Validation - Validation fires twice

    Hi there,
    I have problems with the entity validation in JClient when I have more then one UI-Element that references to the same Data Control / Model Attribute within one panel.
    E.g. I have a table where I display all customers. Above the table I show detail information with editable JTextFields for the customer I've selected in the table. When I change the name of a customer and leave the textfield, the new Value appears also in the table. Thats all ok.
    The problem:
    The entity validation fires twice in that example. E.g. when I insert 30 characters in the name field, but the corresponding database column only stores 20 characters, the
    displayed exception appears twice. When I remove the textfields from the panel
    and edit the values direct in the table, the validation only fires one time.
    How can I avoid that behaviour? I have a lot of screens where it is important to show the list of objects in a table and let edit specific data via text fields.
    That behaviour is also reproducable with the ADFJClientComponentDemo
    (Jtree binding demo). If you insert more characters than allowed in the firstname field,
    the Exception Message is shown twice.
    Thanks for your help,
    Claus

    Hi Fred,
    It's nice to know that somebody out there uses the same technology in a similar way.
    Our L & F is also JGoodies based (we didn't use JGoodies forms).Yes, nice to know. We also only use L&F and not the JGoodies Layout Manager
    (but if JDev 10.1.3 provides that layout manager maybe we use it for new panels).
    In our JClient View project, we used very few try/catch blocks, mostly in our custom
    Navigation bar class (with freeze row function).
    How would you translate the following in 3tiers?
    in the client class:
    try {
    // call a method in the model
    catch (JboException je)
    this.getPanelBinding().reportException(je);
    }We don't use any try/catch-blocks to check for model-exceptions.
    In our application a typical bootstrap code snipplet looks like that:
    =======================================
    //As classmember we have our own ErrorHandler:
    protected HTOErrorHandler errorHandler = new HTOErrorHandler(true);
    //some bootstrap code
    BindingContext ctx = new BindingContext();
    ctx.put(DataControlFactory.APP_PARAM_ENV_INFO, new JUEnvInfoProvider());
    ctx.setLocaleContext(new DefLocaleContext(null));
    //Set Custom Error Handler
    ctx.setErrorHandler(errorHandler);
    =======================================
    Our Custom Error Handler Looks like this:
    =======================================
    public class HTOErrorHandler extends DCErrorHandlerImpl
    boolean inReportException = false;
    public HotErrorHandler(boolean setToThrow){
    super(setToThrow);
    public void reportException(DCBindingContainer bc, Exception ex){
    disableAppendCodes(ex);
    showPopup(ex);
    super.reportException(bc, ex);
    private void disableAppendCodes(Exception ex){
    JboException jboEx = (JboException) ex;
    String baseMsg = jboEx.getBaseMessage();
    String detailMsg = jboEx.getDetailMessage();
    String errorCode = jboEx.getErrorCode();
    Locale defaultLoc = Locale.getDefault();
    Object[] detailExceptions = jboEx.getDetails();
    if ((detailExceptions != null) && (detailExceptions.length > 0)){
    for (int z = 0, numEx = detailExceptions.length; z > numEx; z++){
    disableAppendCodes((Exception) detailExceptions[z]);
    public void showPopup(Exception ex){
    DialogMessage dialog = new DialogMessage((JboException)ex);
    dialog.setVisible(true);
    =======================================
    The DialogMessage is our own ModalDialog to show the ErrorMessages with
    a userfriendly dialog (e.g. we show some error/warning/info-icon...)
    Each time we throw a exception in a EntityObject the framework ensures that
    the Message is shown in our own ModalDialog without using try/catch-blocks
    and the this.getPanelBinding().reportException(je)-method;
    We wrote our own ModalDialog because of L&F-reasons. But you said that
    you use the Standard-Dialog. IMHO you must neverlethess use the setErrorHandler-Method
    in 3-tier mode, but you needn't to write your own ErrorHandler, you can use the
    JUErrorHandlerDlg....
    The following line of code is generated by the ide when creating a default form:
    app.getApplicationModule().fetchAttributeProperties(new String[] {"Test2View1"}, new >String[][] {{"Id2", "Name2", "Id3", "AttrTest"}}, null);
    I read somewhere that when opening a panel, one should call that method for all used >properties in 3tiers mode only.Sorry, but we don't currently optimize something like that. For what reason
    do you want to call that method explicit? We don't have a custom method for that.
    I add tests in the validateEntity method and throw a JboException.
    I suppose for 3tiers I will have to replace throw new JboException by ???? No. You don't have to replace that. The framework notifies your client via the registered ErrorHandler.
    So when a mandatory field is empty, the framework displays an error when a commit
    or navigation event is triggered in the nav bar and the user has always access to that
    field.We want to override the default framework message with our own message. So we have
    to throw the exception manually at some point in the entity object. And for that reason
    we implemented a custom validation via MethodValidator, but the framework-validation fires
    an exception BEFORE our custom validation is processed. Maybe you don't have that problem
    because you use the default error messages. Do you use deferred Exceptions? We do so.
    Did you try JClient 3tiers deployments over the Internet?Yes, we tried it via VPN/DSL to validate that our framework interface-usage works both in 2-tier and 3-tier.
    After several attempts we were successfull, but the performance was poor.
    PS Are you connected to skype? Unfortunately no because of firewall restrictions. We only have access to ICQ.
    Regards,
    Claus

  • More Entity Validation problems

    I have 2 screens each based on different entities.
    I seem to get problems when i do the following:
    1) enter correct data in the first screen. Hit submit and correctly move to the second screen
    2) Enter invalid data in second screen, and press submit. At this point the entity validation kicks in and I display the problems.
    3) The user hits the back browser button.
    4) They change information in the first screen and hit submit.
    5) At this point the entiity from the second screen(which contains invalid data) validates again.
    6) Because there are errors in this second entity I can't get pass the first screen again.
    Is this standard functionality ?
    What am I doing wrong ?
    I'm using jdev 9.051 jsp/struts/adf.
    The only solution I have is to move the validation code from the entity to my struts action, but will only do this as a last resort !!

    Clicking the back button, doesn't clear the second entity and therefore it will still fail the validation.
    The user shouldn't click the back button, instead you should supply a "Cancel" button in the second page that will then clear the information that was entered in that screen and will navigate to the first form.

  • Entity validation strange behaviour

    I have a number of method validators against an entity.
    The validators fire for incorrect data entered on the associated screen and once the data is fixed the user is presented with a second screen. All is fine so far ...
    Until the user hits the back button to go back to the first screen. For some reason even though the user enters invalid data the method validators don't fire !!!. Very confusing.
    Does anyone know of any reasons why this should occur ?
    Many Thanks,
    Richard

    Hi,
    I added a page-link to my second page as suggested. Using this method(instead of back button) causes the validation in the first screen to re-fire.
    The previously entered values in the first screen are gone as its a new request.
    I use code from your toystore to pre-create a record in the initializeModelForPage step. This fires when the link is clicked, and part of that code deletes the last entry from the entity cache. Therefore I'm not too surprised this works. As part of this project it has been stated that the users should be able to navigate through the browsers buttons, so I'm still abit stuck. Any suggestions ?
    What i've done for now is to remove my validation from BC4J to my struts actions.
    But because new values aren't recorded in the entity after a back button I also have to manually set the bindings for each screen field in my struts action.
    I'm not an expert in the adf / struts frame work so I could just be missing something.
    On a related point(assuming that i use entity validation) the following happens.
    On my first screen I enter valid data , and then move to my second. I leave the screen in an invalid date before pressing the browsers back button. I then can't get past the first screen as it is still validating the errors in the second screen. Shay mention that I should be using a cancel button in the second screen to navigate back to the first. This is a public user application and I know that the back button will be pressed(its not good web design to remove/disable it anyway).
    Any suggestions.
    It seems that I can't get the ADF framework to work well with wizards and perhaps its best to just use struts for the validation and at the end of the wizard just call a database package to do the DML ?
    Sorry but one last point - to do with the refresh button.
    All my wizards use page forwards to move between screens and I know this can cause oddities with a refresh. What I have noticed is that when even refreshing the first page of my wizard(after leaving it in an invalid state) the screen doesn't change the errors are still there. I would have though the refresh would request a new refreshed page without the struts action errors. I even noticed that a refresh can cause a struts action related to a submit button to re-fire ? Why does this happen as it can cause a big mess.
    Even re-entering the url in the same browser window doesn't cause the screen to properly refresh. The initializeModelForPage steps also do not fire when a refresh happens. I did notice that if I went to a different website and then re-entered the url that the page displayed more as expected and I think the initializeModelForPage step ran.
    I'm sure alot of this is due to the fact that I don't really understand the framework, and thus would be grateful if you could explain why all the above happens. Is it what you would expect to happen ?
    Many Thanks for your time and assistance.
    Richard

  • Is it possible to update the data in entity via System.Data.Entity.DbSet entity

     If i want to insert a record in dynamically created entity, i can do something like,
    System.Data.Entity.DbSet entity = Request.Context.Set(obj.GetType());
    Object Updated = entity.Add(obj);
    but if i want to update the record in same entity how can i do that? Please help i am new to EF.

    Hello Sidra,
    >>but if i want to update the record in same entity how can i do that? Please help i am new to EF.
    If you use the object type, you need to modify its properties by using reflection because at compile time, the type is not known to compiler:
    https://msdn.microsoft.com/en-us/library/axt1ctd9(v=vs.110).aspx
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Execution of entity validation multiple times (adf bc 10g)

    Implementing entity method validators sometimes causes the validation (e.g. validateEntity method) to execute multiple times. We have figured out that this case occurs when we call method setAttribute programmatically when we implement business rules on the entity level. For example in many cases that we want to enforce dml operation execution, we override the method prepareForDML so that the framework works as follows:
    •     calls validateEntity, validates entity for the first time
    •     calls prepareForDML –> setAttribute this method invalidates the entity row
    •     calls validateEntity, validates entity for a second time
    I can understand that sometimes multiple entity validation is necessary and important, there are cases though that this behaviour is not necessary and additionally it degrades performance especially when we utilize sql queries inside the validation (as it executes the queries multiple times).
    Is there any workaround to avoid multiple execution of entity validation or enforce the validation to occur only once, for example after the prepareForDML method and not before?
    Edited by: user647567 on 9 Σεπ 2010 6:58 πμ

    Hi there:
    I don't think JDeveloper provides a switch to bypass the Entity Validation. Too much meddling. MVC model has those layers and advocates reducing unnecessary dependencies between layers. Entities and Views are both in Model layer though. But you can build a view without an Entity and vise versa you can have an Entity that doesn't have default views. So my understanding is the Entity Validation is quite necessary.
    Though from View layer, on a jspx page, you can use command buttons and set their "immediate" property to "true" to bypass form validation temporarily and postpone it to form submission time.
    My understanding for Entity validator is they should be light weighted. You properly should avoid SQL queries directly in them. Instead you should use EntityImpl or ViewObjImpl/ViewRowImpl instead of SQL queries directly in validator.
    If you feel my answer helpful to you, please mark it so.
    Thanks,
    Alex
    Edited by: Alexbie on Sep 9, 2010 11:11 AM

  • Function module to verify if date is valid.

    Anyone know a function module to verify if date is valid?thx

    hiiii
    This function module will be useful.check.
    FM CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
    EXPORTING
    date = pre_date
    EXCEPTIONS
    plausibility_check_failed = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE e002(0s) WITH pre_date.
    ENDIF.
    reward if useful
    thx
    twinkal

  • Aspnet_compiler web.config(132): error ASPCONFIG: Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'

    My latest MVC 5 project built with VS 2013 compiled and works fine on my PC but can not be published to server using command line aspnet_compiler. I kept getting the web.config(132): error ASPCONFIG: Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'
    In my web.config file, I have the following as suggested by many for solution:
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
     <add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    However, the error is persisting.  I have no clue how to fix this.  Hope someone can help.

    Hello FredVanc,
    As you mentions, it could work with your develop environment, so I am wondering it is that on the server machine, the assembly is not there actually. Here are some information I found which might be helpful:
    https://support.microsoft.com/en-gb/kb/958975?wa=wsignin1.0
    https://social.msdn.microsoft.com/Forums/en-US/1295cfa8-751b-4e9b-a7a7-14e1ad1393b6/compiling-error?forum=adodotnetentityframework
    By the way, since this issue is related with ASP.ENT project, I suggest that you could post it to the ASP.NET forum, there are web experts will help you:
    http://forums.asp.net/
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • What  are the usual date field validations

    Hi all,
    can you please tell me what  are the usual date field validations in selection Screen
    Thanks and regards ,
    Madhavi pilla

    Once you declare it as TYPE SY-DATUM, usually that is enough.  Sometimes we will also check that it is not less than '18000101' or greater than '99991231'.  Or if you have a specific date range that applies to your program you could check the field contents against that. I hope this helps.
    - April King

  • Automatic entity validation

    Hi
    We are building an application framework on top of Toplink. One thing we added are field validators that are called on every setXXX(). The validator throws a ValidationException if there is a problem. This is automatic, and the developer doesn't need to care about it. ValidationException are atomaticaly sent back to the form by the framework and displayed using a message pool system...
    Now, we want to add an automatic entity validation system. The idea is to call the validate() method on the entity during the commit of the unit of work. The validate() method performs entity wide validations and throws a ValidationException if the entity is not valid. Of course, the framework must rollback the transaction if needed.
    How can wee do that in Toplink? I thought that events could help us, but I don't think we can throw exceptions from there...
    Any idea?
    Thanks
    Regards
    Eric

    Just to clarify,
    If you add this validation to your status attribute then it will validate that Reason is not null when you change the status to 4.
    If you want to raise an entity validation just add a new Entity Validator and the expression should be something like what you had:
    But slightly different
    Status != null ? (Status==4? (Reason!=null) : true) : true

  • Entity validation across multiple pages

    Hi,
    I have an entity that spans multiple pages and are wondering how I can get the entity validation to work one page at a time. Currently if I have mandatory attributes that are not shown until the second page I receive errors from the first page stating that these muist be entered.
    My current thoughts on fixing this is either to change my model to on epage per entity, or to turn of entity validation (including mandatory attributes) and just do my validations in my struts actions.
    This is a Jsp/ Struts / ADF BC project.
    Many Thanks,
    Richard

    Leo,
    I'm not sure I would have done this with columns. Because of your desire to link from one piece of text to another, in all three columns, I would use linking text boxes. Each of the three boxes on a page will be independent of each other, but can be linked to the boxes on the following pages. Does that seem like what you're looking for?
    -Dennis

  • System.Data.Entity.Core.EntityCommandExecutionException was caught.

     Actually I think it's a bug.
    Exception Details;
    System.Data.Entity.Core.EntityCommandExecutionException was caught
      HResult=-2146232004
      Message=The data reader is incompatible with the specified 'EntitySampleWFA.Source.BO.Student'. A member of the type, 'Id', does not have a corresponding column in the data reader with the same name.
      Source=EntityFramework
      StackTrace:
           source: System.Data.Entity.Core.Query.InternalTrees.ColumnMapFactory.GetMemberOrdinalFromReader(DbDataReader storeDataReader, EdmMember member, EdmType currentType, Dictionary`2 renameList)
           source: System.Data.Entity.Core.Query.InternalTrees.ColumnMapFactory.GetColumnMapsForType(DbDataReader storeDataReader, EdmType edmType, Dictionary`2 renameList)
           source: System.Data.Entity.Core.Query.InternalTrees.ColumnMapFactory.CreateColumnMapFromReaderAndType(DbDataReader storeDataReader, EdmType edmType, EntitySet entitySet, Dictionary`2 renameList)
           source: System.Data.Entity.Core.Objects.ObjectContext.InternalTranslate[TElement](DbDataReader reader, String entitySetName, MergeOption mergeOption, Boolean streaming, EntitySet& entitySet, TypeUsage& edmType)
           source: System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQueryInternal[TElement](String commandText, String entitySetName, ExecutionOptions executionOptions, Object[] parameters)
           konum: System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass65`1.<ExecuteStoreQueryReliably>b__64()
           source: System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
           source: System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass65`1.<ExecuteStoreQueryReliably>b__63()
           source: System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
           source: System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQueryReliably[TElement](String commandText, String entitySetName, ExecutionOptions executionOptions, Object[] parameters)
           source: System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQuery[TElement](String commandText, ExecutionOptions executionOptions, Object[] parameters)
           source: System.Data.Entity.Internal.InternalContext.<>c__DisplayClass14`1.<ExecuteSqlQuery>b__13()
           source: System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
           source: System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
           source: EntitySampleWFA.Source.BO.SchoolManager.IsStandardInNotUse(Int32 standardId) c:\Users\Krkt\Desktop\VS_Projects\EntitySampleWFA\EntitySampleWFA\Source\BO\SchoolManager.cs : Line 138
    Line throws Exception;
    DbRawSqlQuery<Student> sts = sch.Database.SqlQuery<Student>("Select * From [SchoolSchem].[Students] Where StandardId=@StandardId;", new SqlParameter("@StandardId", standardId));
    Business Object;
    [Table("Students", Schema = "SchoolSchem")]
        internal class Student
            public Student()
            [Key]
            [Column("StudentId")]
            [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
            public int Id { get; set; }
            [Column("StudentName")]
            [StringLength(100, MinimumLength = 10)]
            public string Name { get; set; }
            public DateTime? DateOfBirth { get; set; }
            public decimal Height { get; set; }
            public float Weight { get; set; }
            public byte[] Photo { get; set; }
            [ForeignKey("Teacher")]
            public int TeacherId { get; set; }
            public Teacher Teacher { get; set; }
            [ForeignKey("Standard")]
            public int StandardId { get; set; }
            public Standard Standard { get; set; }
    Exception details are above. I think reason of exception is mapping failure at Id Property(Mapping to "StudentId" Column).
    After i have changed columns as StudentId -> Id, StudentName -> Name, There is no any exception. Problem solved.
    Is there another idea?

    Hello,
    try this:
    http://knowledgebase.progress.com/articles/Article/9542
    http://expertland.net/question/253v4r9w21mbb4l7c26u7pmws92pa91l/detail.html

  • Add Data from DataGridView in Data entity framework

    private void ShtoArtikullin()
    //FaturatDetalet fd = new Faturatdetalet();
    System.Data.DataRow newrow = lvShitjetDetajet.NewRow();
    //fd.FaturaID = -1;
    int lastid = 1;
    //if (dtDetaletFatura.Rows.Count == null)
    lastid = lvShitjetDetajet.Rows.Count + 1;
    newrow["FaturaID"] = lastid;
    newrow["ArtikulliID"] = lvArtikujt.SelectedRows[0].Cells["ID"].Value;
    newrow["Emri"] = lvArtikujt.SelectedRows[0].Cells["Emri"].Value;
    newrow["Njesia"] = lvArtikujt.SelectedRows[0].Cells["Njesia"].Value;
    newrow["Sasia"] = 1;
    newrow["Cmimi"] = lvArtikujt.SelectedRows[0].Cells["Cmimi"].Value;
    newrow["Totali"] = lvArtikujt.SelectedRows[0].Cells["Cmimi"].Value;
    //DataRow r = newrow;
    //newrow["Barkodi"] = dgArtikujt.SelectedRows[0].Cells["Barkodi"].Value;
    dtDetaletFatura.Rows.Add(newrow);
    ////selektimi e percjell artikullin e fundit
    dgDetaletFat.Rows[dgDetaletFat.Rows.Count - 1].Selected = true;
    //dgDetaletFat.ClearSelection();
    //e fshin tekstin ne txtserch te artikullin e shtuar
    txtSearch.Text = "";
    I need this code to do in Data entity framework,this kode is to add data from one datagridview to another datagridview it work well in sqldataadapter but i need  to do in data entity framework  how to do this?

    If you add these entries to an observablecollection and put that in application.current.resources.  Use that same observablecollection in both datagrids. 
    When you add an entity in one DataGrid  then it will appear in the other one.
    Although it is not really what the sample is about, you can see a simple way to  share an observable collection across views in this:
    https://gallery.technet.microsoft.com/Dynamic-XAML-Composed-View-e087f3c1
    I don't quite follow where the selecting comes in with your code but that sample also uses the current item to share which is selected.
    I also recommend wrapping an entity in a row viewmodel.
    As I do in this:
    http://social.technet.microsoft.com/wiki/contents/articles/28209.wpf-entity-framework-mvvm-walk-through-1.aspx
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

Maybe you are looking for

  • How to assign the result value of a sql stmt to a variable in sql*plus

    e.g. var v_date var v_test :=select hour from tablename where date=v_date

  • Flash Video mystery

    Hi all, I'm in charge of our company website. We have recently had to move to a new host. All of the Flash files work except for the ones containing video, examples are here:Ex 1 / Ex 2 / Ex 3http://www.nightingaleassociates.com/primary-capital-actio

  • Sound Input Read VI hangs

    I'm using the SI Read VI to sample from the Soundblaster card in my Dell PC. I've configured the device for 16-bit mono input, sample rate 44.1 kHz, and the buffer size is 1024 samples. The SI Read VI is in a Timed Loop whose period I've set to 23 ms

  • "Include transparency" on export to QT?

    Okay, what does this mean, anyway? When exporting a Keynote show to QuickTime, one of the options is to "include transparency". What does that mean? What gets identified as "transparent"? --Dave Althoff, Jr.

  • Spring MVC n JSP

    Hi I'm using spring MVC framework to design an application. I'm accepting the user login id and password,verifying it with thw database and then granting access to the next page. The prob is, after logging in if the user clicks on the browser back bu