Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADO.NET Entity Relationship with Stored Procedures [DNET424] #422

Closed
firebird-automations opened this issue Apr 3, 2012 · 2 comments
Closed

Comments

@firebird-automations
Copy link

Submitted by: @cincuranet

=== from thread "http://ADO.NET Entity Relationship with Stored Procedures" [meubanks] ===
I imported a few Stored Procedures into an http://ADO.NET Entity Modal that insert
data but it does not seem to be committing to the database. What am i
missing here:

        FbDb db = new FbDb\(\);
        db\.ADDUSER\(UserName\.Text, Password\.Text, Email\.Text\);
        db\.ADDSITELOGIN\(UserName\.Text, 123\);

        db\.SaveChanges\(\);

These store procedures work fine when executed using my DBManager.

1. Create a stored procedure in any Firebird database.
2. Have the SP insert values into your database using a couple of parameters you pass to your SP.
3. The prototype would look something like this: Execute Procedure MySP(value1, value2);
4. From a web project in Visual Studio 2010 add a "New Item..." to your project. Select "Data" from "Installed Templates" and choose "http://ADO.NET Entity Data Model"
5. On the Data Model work area right click in the white area and select "Update Model from Database..."
6. From the "Update Wizard" dialog box "Add" tab, select "Stored Procedures" and select the stored procedure created in steps 1 & 2 and press Finished
7. Click "View" then "Other Windows" then "Entity Data Model Browser"
8. In the "Model Browser" tree, select "Stored Procedures" under your database .Store branch (See Capture 1)
9. Right Click on your stored procedure and select "Add Function Import...."
10. None of the options in the "Returns a Collection of" or "Get Column Information" sections works but that is another issue...
11. Click OK
12. In your code create an instance of you entity modal object.
13. Notice that the modal object has a method for you stored procedure with the input parameters. At run-time the method executes successfully but the database remains unchanged. I did not make any changes to the modal's underlying code.

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Closing because of missing (even in the original thread) code to test it.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Closed [ 6 ]

resolution: Incomplete [ 4 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants