.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Santhakumar Munuswamy
Asad Ali
Fauzul Azmi
Post New Web Links

Update Database Schema without redeployment in Entity Framework

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :.NET Framework
 
Hello. we build an app with 2 layers i.e the presentation and the Business layer which holds the business logic and have the entity framework provide us wtih entities. my question here is is there a way we can change the database schema and not have to redeploy the app to the client.  


View Complete Post


More Related Resource Links

Multiple database support with Entity Framework

  
One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Custom Entity Framework template and access to the database type

  
First and foremost ... I already made a few changes in the template, the most important one changing the methods generated for stored procedures with OUTPUT parameters and no resultset so that instead of instantiating a few OutputParameter objects, passing them to the method and extracting the values (all without any type checking) you just call the method with a few "out someType?" parameters so I do not need the very basics. I am totally confused by all those GlobalItem, EdmProperty, BuiltInTypeKind, TypeUsage and all this made of objects, all alike and all different though so as soon as I need more data than what's already used by the template I run into problems :-(What I would like is to change the WritePrimitiveTypeProperty() so that it outputs [StringLength(xxx)]  for all char, varchar, nchar and nvarchar properties. But I can't find a way to get from an EdmProperty in the model to the database type in the store.Can anyone help me?In case anyone is interested here's the modified stored procedure mapping code for the template. The first code replaces the original in the .tt: //////// //////// Write EntityContainer and ObjectContext Function Import methods. //////// region.Begin(GetResourceString("Template_RegionFunctionImports")); foreach (EdmFunction edmFunction in container.FunctionIm

why two records are inserting in database using Entity Framework??

  

Hello,

i am using entity framework to access the database to insert/fetch data from database.

consider i am having two tables "AssetCheckList" and "TaskRecheckDetails"

AssetChecklist  Table

AssetChecklistID

AssetName

 

TaskRecheckDetails

TaskRecheckDetailsID

ParentAssetChecklistiID - Forigen Key of AssetCheckListID

RecheckAssetChecklistID -  Forigen Key of AssetCheckListID

 

when inserting the data in TaskRecheckDetails table two records are inserted with same details.

why and how to resolve it.

 

please help.

 

Thanks!

 


How to display image from database using MVC2 & Entity framework.

  

Hello,


I am very new to MVC and entity I have being searching all over the internet on how to do this. Please help.


I need to do a site similar to http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx but don't know how to display or retrieve the images as in the above website.


Thank you so much!


Databinding of WPF DataGrid with database via ADO.NET Entity framework

  
I develop WPF 4.0 desktop-based application that has to work with SQL Server database. In order to connect database with my GUI WPF-application I decided to use ADO.Net Entity Framework. I made edmx-connection, all works as expected, I see the structure of my DB in model browser.

After that in WinWorkers.xaml.cs I wrote basic LINQ-query that returns all data from tbl_users and I put it to IBindingList, here is a code fragment:
//databinding with database via LINQ query
IBindingList users = ((from d in App.glidusContext.tbl_users
            select new { d.userID, d.userName, d.userPassword }
          ) as IListSource).GetList() as IBindingList;

In order to show this data I chose to use DataGrid control inside of XAML-code, here is a code fragment of that:
<!--databinded content from database-->
<DataGrid 

Could not establish connection database. ASP.NET Membership and Entity Framework

  

Ok, so this is my first Solution using the Entity Framework (EF). Here are my steps so far:

1) Created Database named: BSA with an owner of username/password (AspNetServicesUser/password)
2) Created Entity Data Model (EDM) in a separate project (contained within the same solution)
3) Created an ASP.NET Web Application with basic functionality (new project within the same solution)
4) Added Reference to the EDM in Web App and added Connection String to the EF
5) Decided I wanted ASP.NET Membership added to the Web App
6) Configured SQL Server for Application Services using aspnet_regsql.exe on BSA database

Now, I need to know:
a) Should I keep the ASP.NET Membership Tables in a Separate DB altogether?
b) Should I update the EDM to include the ASP.NET Membership Tables?
c) Then, how do I create the connectionString for the Web.config file in the WebApp?


FYI: I get this error using the ASP.NET Configuration Tool under the "Security" Tab:
Login failed for user 'AspNetServicesUser'.

FYI: I get this error using the ASP.NET Configuration Tool under the "Provider" Tab --> Select a single provider for all site management data --> Test
Could not establish a connection to the database. 
If you have not yet created the SQL Server database, exit the

Unable to connect to Database | ASP.NET Membership and Entity Framework

  



Ok, so this is my first Solution using the Entity Framework (EF). Here are my steps so far:

1) Created Database named: BSA with an owner of username/password (AspNetServicesUser/password)
2) Created Entity Data Model (EDM) in a separate project (contained within the same solution)
3) Created an ASP.NET Web Application with basic functionality (new project within the same solution)
4) Added Reference to the EDM in Web App and added Connection String to the EF
5) Decided I wanted ASP.NET Membership added to the Web App
6) Configured SQL Server for Application Services using aspnet_regsql.exe on BSA database


Now, I need to know: 
a) How do I create the connectionString for the Web.config file in the WebApp?


Errors I receive:

I get this error using the ASP.NET Configuration Tool under the "Security" Tab:

Login failed for user 'AspNetServicesUser'.


I get this error using the ASP.NET Configuration Tool under the "Provider" Tab --> Select a single provider for all site management data --> Test

Could not establish a connection to the database. 

If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database

how to change the database while using Ado.Net entity framework?

  

HI....

how to change the database while using ADO.Net Entity Framework?  

I have two identical databases. I want to change the db. Can i change it through web.Config?

Like LINQ to SQL ?

 

 

 


Update to .NET 3.5 SP1 Released (Dynamic Data Entity Framework Issue Fixed)

  

An update to .NET 3.5 SP1 has been recently released, you can search for KB959209 in the Microsoft Knowledgebase. Here is a direct link to the article: http://support.microsoft.com/kb/959209. This update is important for Dynamic Data users that are using the Entity Framework as it corrects the problem that the RTM version of Dynamic Data had with certain types of relationships with Entity Framework. This can been seen with 1->0..1 and *->1 relationships which may generate error messages like "'System.Web.UI.WebControls.EntityDataSourceWrapper' does not contain a property with the name 'Orders.OrderID'". Download and install this update to correct this issue.


Partial update with stored procedure in Entity Framework 4

  

How do I use a stored procedure to change one or more (but not all) fields of a entity in EF4? I have a stored procedure "ChangePassword" taking a username and and a password as parameters and a User entity containing properties for Username and Password as well as other properties. I want to be able to use this stored procedure from a function to update the password from a function in one of my repositories. How to do this?


HELP: Creating an ActionResult method to display a particular database record using Entity Framework

  

Hi All,

I have an ActionResult method that displays records from a database table (below):

namespace STD.Controllers
{
    public class StudentController: Controller
    {
        StudentEntities stud;
        
        public StudentController()
    {
        stud= new StudentEntities ();

    }

        public ActionResult Index()
        {
            ViewData.Model = stud.StudentTable.ToList();
            return View();

        }
}

I want to design a method "ActionResult Student()" that accepts "Student ID" as a parameter and displays record for that particular student only.

What do I need to do to make this happen? Could anyone please help me with this?

Thanks in advance

 


Creating a Generic Entity Framework 4.0 Repository

  
With .NET 4.0 right around the corner, I thought it would be cool to download Visual Studio 2010 beta 2 and start playing around with the next release of Entity Framework.

The initial release of Entity Framework came with a great deal of criticism. To make matters worse, there was a large uproar when it was rumored that Microsoft would be abandoning LINQ to SQL, in favor of Entity Framework. This was because, at the time, many developers felt Entity Framework was an inferior technology to LINQ to SQL. To set things right, Microsoft proactively moved forward with improving Entity Framework, in time for the 4.0 release of the .NET Framework. This is good news because my initial impressions, so far, have been nothing but positive.

ASP.NET 4.0 Dynamic Data and Many to Many Entity Framework Entities

  
I did not play much with Dynamic Data controls in VS2008 and just made a cool discovery in VS2010 Beta 2. This may not even be new, but as I'm sitting 30,000+ feet over the Atlantic ocean, I don't have access to VS2008 at the moment to check.

Entity Framework 4 Tips for WinForms Development

  
I've been recently working on a smart client (WinForms) application backed by Entitiy Framework 4 (EF4) on Visual Studio 2010. In this blog post I will try to give you some tips regarding some limitations and points to be careful about EF4.

How to extract a schema from a sql server database

  

Hi,

  I need to extract or get the schema from tables in my databse and what is the best way to do it. Is there any third party tool to do it??

 

Any idea will be appreciated..

Thanks

Karen


Data accessors or Entity framework

  

The entlib 5 sugest me to use with data accessors for mapping data from database to my data objects (ORM).

But in .NET 3.5 and especially in .NET 4, I can use in entity framework as ORM methodology for data objects.

What data accessors uses advantages over the entity framework?

What differences that should be affect on my using decisions?


Data Points: Deny Table Access to the Entity Framework Without Causing a Mutiny

  

Julie Lerman shows database administrators how to limit access to databases from the Entity Framework by allowing it to work only with views and stored procedures instead of tables-without impacting application code or alienating developers.

Julie Lerman

MSDN Magazine August 2010


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend