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


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

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

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net
 

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


View Complete Post


More Related Resource Links

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

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.

VS 2010: no Entity Framework or LINQ support for SQL Server 2000 SQLOLEDB connection?

  
Hello, I'm working with Visual Studio 2010 and for Data Connections am connecting to a SQL Server 2000 production database. When I try to drag a table to a .dbml file, the Object Relational Designer says, "The selected object(s) use an unsupported data provider."If I try to create an .edmx file via Generate from database, then the alert is, "This server version is not supported. You must have Microsoft SQL Server 2005 or later."So VS 2010 has no support for the Data Entity Framework or LINQ when connecting to a SQL Server 2000 database? If that is the case, what is the best data access strategy for this scenario?  

Update Database Schema without redeployment in Entity 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.  

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

Can not establish a connection to SQL Server 2008 R2 via Visual Studio 2010 Framework 4.0

  

Hello All, I would appreciate any help with this.

I believe my problem exists within the web.config which already had code in it to connect to SQL Server Express 2008.

I uninstalled the SQL Server Express that came with Visual Studio 2010.

I installed SQL Server 2010 R2 Developer, and I'm able to connect via Management Studio and through Visual Studio's Server Explorer's Data Connections I am connected.

I did run aspnet_regsql.exe within the 4.0 folder in order to create the database with Microsoft Service Providers.

Here is the ServerName: USER-5529234649 

Here is the name of the DataBase:  StepByStepChapter9

Here is the name of the Connection within Visual Studio's Server Explorer's Data Connections:  user-5529234649.StepByStepChapter9.dbo

Here is the code I changed in the web.config:

<configuration>
  <connectionStrings>
      <!--<add name="ApplicationServices"
            connectionString="data source=.\SQLEXPRESS;Integrated   Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
            providerName="System.Data.SqlClient" />-->
      <add name="ApplicationServices" connectionString="data source=user-5529234649\Step

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 

Entity Framework and ASP.NET Membership and CRUD

  

Forgive me for asking such a simple question, I know I should be able to figure this out, but it has been hours and I still don't have a solution.

I have a simple DB that has the aspnet Membership tables added into it (cf. aspnet_regsql.exe).  In addition, I have a UserProfiles table to store additional user info like FirstName, LastName, Sex, Age, etc.

There is a foreign key relationship between aspnet_Users and UserProfiles, using the UserID field.

The functionality I desire is:
1) A 1:1 relationship between aspnet_Users and UserProfiles; there should only be 1 Profile per aspnet_User.
2) When an aspnet_User is created, that UserProfiles would inherit that UserID created for the aspnet_Users row
3) CRUD operations that cascade.  If a aspnet_User is deleted, so should the corresponding UserProfile.

Question(s):
a) Is all of this supposed to be handled in the EDM Designer?
b) Should I use map custom stored procedures?

Thanks in Advance


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 ?

 

 

 


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.

localhost is not set up to establish a connection on port 51624 with this computer

  

I'm trying to run asp.net locally, but getting the error

localhost is not set up to establish a connection on port 51624 with this computer

How can I fix it?


Unable to make connection to database?

  

Hy guys. I try to connect my database for so long so i wrote two type of codes. Let's discuse first on.

I have database called PhoneDirectory.

It have only one table named Residents.

I have button wiht ID="Button1".

I want when i click this button to see all of my residents. 

I want to see the result in DetailsView and to be able to edin, delete and add new resident.

First try with SqlDataSource so i wrote this:


<asp:SqlDataSource ID="Resident Details" runat="server" ProviderName="System.Data.SqlClient" ConnectionStrings="<%$ ConnectionStrings:ThisIsTheConnection%>" 
              SelectCommand = "SELECT * FROM Resident "
              UpdateCo
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