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

Similar Messages

  • Ora-06550 returning data from Stored Procedure and Entity Data Model

    Hi.
    I'm creating an application that uses a WCF Service to return data. I also created a proyect with the EDMX design and mapped most of my DBModel to a classes context. I have added some of the procedures as well. One of them receive some parameters and return a Sys_RefCursor, that is populated according to the parameters.
    I have declared the "<add >" tags in the Web.Config and imported the function of the Procedure. When I call the Asyncronous function I get different exceptions:
    1. If I call the function, with all of the parameters i get:
    Oracle.DataAccess.Client.OracleException: ORA-06550: línea 1, columna 8:
    PLS-00306: número o tipos de argumentos erróneos al llamar a
    'SP_HECHOSJURITER'
    ORA-06550: línea 1, columna 8:
    (wrong number or types of arguments in call to 'SP_HECHOSJURITER')
    2. If i just set 1 parameter in the SP, returning the same type of data, I get:
    Error al recibir la respuesta HTTP a
    http://localhost/Procalculo.CGFM.SIGOC.DatosServices/ServiceDatos.svc.
    (failed to receive http response. error 12152)
    3. If I don't set any parameters in the procedure, it works fine, and return correct data.
    It exclusively happen with one entity.
    Any clue?
    I appreciate any help.

    When you return result sets from stored procedures to Entity Framework, you are very likely using implicit result sets. Implicit result sets don't need to be declared as a parameter in code, only in the <add> tags to define the metadata in the .NET config file.
    For example, in the EF Oracle By Example, you'll see that the stored procedure in the function import has three parameters, but only two are declared in the code. The third one was defined in the config file.
    http://download.oracle.com/oll/obe/EntityFrameworkOBE/EntityFrameworkOBE.htm

  • Updating data from PSA to Data Target

    Hi,
    I just want to update data from PSA to data target.
    There is a process chain running daily it will updating Master Data in to 0Vendor object. This process chain is updating only upto PSA not the data target. I just want to update from PSA to data target.
    There is a update rule for 0Vendor but itu2019s not active at the movement and also it is not properly mapped with the 0Vendor.
    Is there any other method which I can update data from PSA to Data target with in the same process chain.
    Thanks
    Ganesh

    If this is BW 3.5, change the infopackage setting to load to data target as well.
    This is a other w ay than using the update from infopackage.
    if this is 7.0, Use the DTP to load from PSA(datasource) to Target.
    Let me know if this helps.
    Thanks
    Sachin

  • Error in Source System While Uploading Data from ODS to Data Target

    Hi All,
    Iam getting Following Error while Uploading data from ODS to Data Target
    a) Error in Source System.
    b)DataSource 80MKT_DS01 has to be replicated (time stamp, see long text)
    Message no. R3016
    Diagnosis
    DataSource 80MKT_DS01 does not have the status of the source system in the Business Information Warehouse.
    The time stamp in the source system is 21.06.2005 07:31:33.
    The time stamp in the BW system is 27.11.2004 17:41:45.
    Regards,
    Chakri

    This generally occurs when you change the data source or enhance the data source or the coonections to the datasoiurse are broken. To resdolve thius sort of errors just
    1. Check for the coonect between the sourse & target systems
    2 . Replicate the data sourcses.
    3. Acivated TR,UR,& the rest of the flow But check in the source system if the structre is modified & is so do the changes in the IS , TR,UR correspondingly & the try to load .Hoppe it allows you to load .
    Thanks ,
    PSG

  • Adobe offline form with capablity to read data from a local data base.

    Hi ,
            We have customer requirement for a offline Adobe form which will be used by Sales rep, this form when saved to the local hard disk is required to read data from another local data base available in the laptop  and prefill a few fields in the form . 
    Is this requirement technically feasible using Adobe forms?
    Thanks
    Srikanth S

    Well may be it's possible because if you go to the Data View in ALD and create a new Data Connection --> OLEDB database --> Build --> It gives you various options for connecting to different DBs but frankly speaking I have never tried it.
    Check the ALD help for more information on the topic.
    Using LiveCycle Designer > Working with Data Sources > Connecting to a data source > To create a data connection to an OLE database
    Chintan

  • Weblogs: Cycle Count Inventory Date: From IM inventory date to WM inventory

    Dear All,
    I have updated new weblog on the common problem for physical inventory.
    When any organization plans to go for implementing the warehouse management; it has major concern about the physical inventory process, particularly last physical inventory date.
    More details are available on this weblogs:
    /people/community.user/blog/2007/10/04/cycle-count-inventory-date-from-im-inventory-date-to-wm-inventory-date
    <b>Your feedback/comments are most welcome, <u>Please write on the weblog page, not in this thread.</u></b>
    Regards
    Arif Mansuri

    Dear All,
    Here is my previous weblog, Your comments will work as tonic for me ), so leave your comment on both of these blogs.
    /people/community.user/blog/2007/05/04/physical-inventory-in-material-management
    Enjoy SAP..
    Regads
    Arif Mansuri

  • Determine previous date from the selection date

    Hi Guys,
    I need to get a previous date from the selection date mm/dd/yyyy
    Eg:
    Selection date is 02/28/2008
    Sol- -02/27/2008
    Selection date - 03/01/2008
    Sol- 02/29/2008
    Selection date - 04/02/2008
    Sol-04/01/2008
    If i do ofset -1 in query ....it goes -1 month. In Exit if i do Sys-datnum -1. It works but not in case for Feburary month. Since 2008 year has Feb (29 days) but for 2007 (28 days)
    Regards

    Hi,
    Problem is i have a 0Date restricted to a variable and if i do offset-1 to that variable it goes previous month not the date.
    I dont have 0CALDAY in my cube. Can i do in the UserExit.
    If i do sy-datum-1. Will it work?
    Because the FEb one is the main problem
    Regards

  • Extracting data from ms sql data base

    Hi Experts,
    we have a requirement of extracting data from MS SQL data base,could any one pls help me with the approach to extract data
    from ms sql data base(actually we have to extract the data from PRIMAVERA i.e the back end data base is MS SQL data base and the application is built on java)so we have got two options one is using ud connect and the other one is using PI(XI).i came to know the two approach have based on differenct methods,pull and push mechanism.and also for PI,it can be extracted using
    real time data acquisition property in dtp and for db connect it don't support real time data acqusition.
    so pls guide me,which mechanism would be feasible to extract the data from PRIMAVERA to SAP BI.and can you suggest with methods is more efficient.
    Thanks in advance.

    Hi thanks for the reply,
    initially we tried with db connect,but our Bi system(oracle) is mount on unix OS and the Primavera(MS Sql DB)is on windows OS.so we could not found the data base shared library  once if the DB client is installed on the application server.so we are working around with the other possibilities,so can you suggest me which could be favarable in our case.
    Thank You.

  • Passing data from datagridview to textboxes

    Hi Guys,
    I need help in passing data from a datagridview control to textboxes. I have a simple windows apps with 2 forms, when the user doubleclick a value from a datagridview control in form1, I want the record to be displayed in the texboxes of form2. How do I go about coding this? Any help would be highly welcome.
    Cheers

    Hi,
    add this statement before calling rfc
    input.set<Node Name which contains the attributes>(validationInput);
    the sample code to pass information is like below
    Zfxx_abc_Validations_Input input = new Zfxx_abc_Validations_Input();
    wdContext.nodeZfxx_abc_Validations_Input().bind(input);
    Zfxx_abc_Hd validationInput;
    validationInput = new Zfxx_abc_Hd();
    validationInput.setBelnr(acctDocNumber);
    validationInput.setBktxt(docHeaderText);
    validationInput.setBldat(docDate);
    input.set<Node Name which contains the attributes>(validationInput);
    wdThis.wdGetHeaderInfoCompController().executeZfxx_abc_Validations();
    Regards,
    ramesh
    Edited by: Ramesh Babu V on Jul 31, 2008 10:32 AM

  • How do you display data from two different data-sets on one list

    I have a data-set that is displaying properly; I would like to add another data-set to the other portion of the form. 
     The first part of the data set has Product information (Product-Name, Product_number, etc),
     The second portion of the data-set has information like (Product-campaign, Product-Sales, etc)
    The two data-sets  are mutually exclusive

    Hi xitum,
    As
    Patrick  Hurst mentioned, if the several tables didn't have any relationship with each other and you want to put all the information together to display in one report, you need to add several tablix/list in the same report and each tablix/list to display
    the data from each table.
    If the several table have a same relationship field you can use the
    lookup function to get the other maped fields display in the same tablix/list.(this function supportted on the SSRS 2008 r2 and later version).
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • BPEL Integration Layer to extract/manipulate data from Oracle PIM Data Hub

    What would be best integration option for the design of BPEL framework that enables extraction and transformation of data from Oracle PIM. This Integration layer would be responsible for the transformation of the extracted data from Oracle PIM and it will also propagate this info to several other interfacing systems in respective formats.

    There are multiple ways to do this. ODI, Essbase Studio or SQL interface in load rules are three. ODI is not free, but the other two I mention are. There are a few developers I know that prefer flat files as it is easier to trace back issues, but most o us use a SQL approach. Both Essbase Studio and Sql Interface can use either PDBC or OCI connections. Of course OCI connections are faster.
    While neither Studio or load rules has a scheduler associated with it, you can use the windows/cron/custom scheduler of your choice to schedule the process to run. Note that neither will run stored procedures/packages but just read from tables/views.
    The batch interface you would use is called MaxL and it interfaces with ODI, Studio and Load rules (Sql interface)

  • Funds management cube getting data from 4 ods, data not seen in cube

    Hello all,
    I am working on funds management cubes (0PU_C02 and 0PU_C03). These two cubes get data from like 7 or 8 ODS. Can someone tell me which are the ODS which feed to respective cubes. I have the mappings done but i am getting very confused.
    In the ods 0PU_O44 there is RLDNR for Ledger and I can see that data in ODS but when i run load to cube I dont see the ledger data (its direct mapping there are no routines or rules).
    Is there any sequence with wihic we have to load the data?
    Thanks
    Message was edited by: Raj M

    Hi Raj,
    I was going thru the forums who has knowledge in Public sector when i came accross ur forum.Can i get your email id..i have some questions to ask regarding student administration.
    thanks.

  • Unable to export data from Web Access Data Sheet in Sharepoint to local excel or access file

    Greetings and good morning.
    I'm going to start off in broad terms with this question because I'm not 100 percent sure what information to provide.
    Long story short, we've got a Web Access Data Sheet list hosted in a Sharepoint 2010 environment. It is accessed and used by multiple people throughout the day. It contains several thousand line item entries. I'd call it a large data sheet.
    I think the size of the data sheet is casuign some instability in the list. I'd like to be able to export a defined range of data from the list into a local excel or access file. After that, I'd delete the stuff on the Access list to improve performance.
    But...when I attempt to use the Sharepoint Action bar to export - Excel locks up/crashes. If I try to export to Access, I get a similar issue.
    Any ideas? Could anyone begin by telling me what other information is required?

    Hi,
    If you would like to export data from Access Web Database in SharePoint 2010, you could go to Design With Access page in Settings. The url in my environment is http://sp/tt/_layouts/accsrv/ModifyApplication.aspx . Then choose the Table and export it to Excel
    or Modify it in Access.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • How to send data from 4 different data sources to one ODS

    Hello Gurus,
    There is a transaction called KSB1 in R/3.
    It has data related to cost center , cost element, G/L .
    In BI, i need to transfer the data from these Data sources to one ODS.
    Can any body give me some idea.
    Points will be awarded for any kind of response .
    Thanks .
    Anu

    Hi Rupa..
    In your requirement some data sources (Cost centre, Cost element) are master data sources.
    They are available as info Objects in BI (Content).
    So there is no need to create ODS on these.
    But the general scenario for creating ODS from multiple data sources in case of Transaction documents
    Like :
    PO header, PO line items...
    For this the Pre-requisite is to have common fields between these data sources (eg PONo).
    Hope this gives idea for u....
    Cheers...
    Varma

  • SSRS pulls data from ESSBASE cube, data not showing

    Dear Experts,
    We are connecting SSRS 2012 to Essbase 11.1.3 to pull data from the cube, and having some issues with some members data not showing in the query designer and report, while some have no problem. And we couldn't find a pattern on which members won't show. We are wondering if this is a known issue and if there is a way to solve the problem.
    Thanks very much.
    Grace

    Hi ,
    Check the following:-
    1 Check whether you have made the joins properly.
    2 Check data at multiprovider level .
    3 is data available for reporting in both the cubes
    Regards
    Rahul

Maybe you are looking for

  • How do i set up mutliple devices with one apple id

    My wife and I have 2 i phones and now a new i pad, we share an apple ID from one computer, songs apps, contacts but have seperate email ect. Now she has a i pad and wants to be able to text from it using her cell, as it stand now if she sends a text

  • Style selector not working...

    Why does the mx|ToggleButtonBar style selector not work in the following code? <?xml version="1.0"?> <!-- Simple example to demonstrate the Halo TabNavigator layout container. --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"               

  • Developing third party  UWL connector using NW04 SP14

    Hi I am developing the 3rd party UWL connector following the guide below. https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00ff559e-c563-2910-17a7-c902dbef9a16 I am using NW04 SP14. It seems the UI for configuration mentioned in do

  • Junior oracle database jobs

    please who can assist me on how i can get a junior oracle database job. i am an oracle certified professional 9i.

  • Use Google's Public DNS Server To Fix Apple TV Streaming Problems

    Many people have been having a streaming problem with the Apple TV - especially with Netflix. In fact, it's often the most popular topic on this forum. After having the same problem off and on for two years, I finally figured out the following soluti