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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Net Framework Question

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :.NET Framework
Why if I have net framework 4, 64 bit on my windows 7, when I boot up my computer it says it's missing net framwork 2?

View Complete Post

More Related Resource Links

Entity framework simple question




First I am newbie using EF - so sorry on this basic question


I have a Project Table that relate to Company Table


When I Map with EF I Do not have property of CompanyId in the Project Object

But I have related Company Object


For example

Project p = new Project();

p.CompanyId è does not exist!

When I try addingit myself I get this error:

If I need just the Company id, and I don't want get it like

p.Company.CompanyId - because than the application try connect again to the DB and I don't want this, because I need just the CompanyId.

What the best regular way to get it?


Entity framework noob question

I have been struggling to understand how this works. In the image above i have these db tables generated by Entity Framework. Problem is it seems that when i use the code below to assign the location values obtained from a listbox to the division being created/edited EF creates a new location and then enters that locations id and the divisions is into the DivisionLocation table thus creating multiple locations unnecessarily, as depicted below. using (FRLEntities context = new FRLEntities()) { for (int i = 0; i < lstPicked.Items.Count; i++) { var lpn = cm.GetLocation(Convert.ToInt32(lstPicked.Items[i].Value)); Location cLocation = new Location { LocationId = Convert.ToInt32(lstPicked.Items[i].Value), LocationName = lstPicked.Items[i].Text, LocationParentName = lpn.LocationParentName }; //CurrentDivision.Location = new EntityCollection<Location>(); CurrentDivision.Location.Add(cLocation); } } Division Divisionid            DevisionName 1                            1st Division 2    &nb

WCF and Entity Framework Design question

Should we be using Entity Framework entities as data contracts across the WCF Layer? If yes when why have the POCO support and code only been added to the Entity Framework? I was assuming it was with the purpose to remove the dependancy that the client will have on the database if the client depends on the Entities. If No, then does that mean we need to create Business Objects for each entity that exists in the entity framework model? Please advise. Thanks.Nilotpal

Question regarding having multiple versions of the .net framework


Hi guys,

Sorry if this sounds silly, but it's been getting to me for quite a while now.  I've been having some issues installing both .net framework 3.5 and 4.0 on my computer since I have certain software that either requires one or the other to run.  I've tried over and over again to install framework version 3.5 from your web site, but each time, the result is the same.  I always get the error that I mustconfigure the framework from the control panel.  Yet I see nothing about that in the control panel.  Maybe it would help you to know that I had first found .net framework through IIS when I went to put that in there, and so I've been trying to install it from there.  Every other framework version works fine except for version 3.5.  I unfortunately cannot provide any logs since my computer is currently with the Gordon college techs due to another issue, but any help on this would be appreciated.  Thanks. 



Entity Framework Inheritance Question



I have two tables in my EDMX, I'll call them table A and table B.  I would like for table B to be inherited from table A, so A is the base type and B is derived from A.  I have set this up in my EDMX file as such by removing the association between the two tables, adding the inheritance and deleting the duplicate columns in B.  All fields are mapped properly and I have mapped the insert/update commands to stored procedures.  When I run run a test to save changes to B, I get no errors.  However, none of the fields in my base table, table A, are updated.  And when I try an insert, I get an error saying there is a foreign key violation.  When I checked with SQL profiler, I found that only the stored procedure to insert into table B is called.  I would need for the insert to table A to happen first, then table B.  But this is not happening and my update is not even touching table A.  Is there anything special I need to do to make sure that both tables are updated properly and the inserts are done for both (and in the correct order)?

Any tips would be greatly appreciated.


Question about WSS SP1, Framework 3.5, AJAX-WebPart


We can't see any difference related to AJAX when installing the WSS SP1? No changes in _spFormOnSubmitWrapper()

in INIT.JS or in the body and form of default.master and application.master?


In addition to the code of http://msdn2.microsoft.com/en-us/library/bb861877.aspx we still need the following additional code to make AJAX-WebParts run properly:


Code Block

protected override void CreateChildControls() {






private void FixFormAction() {

if (this.P

Question on deleteObject in the Entity framework


I want to delete a record from a table, but I want to save the data in a deleted table (as in a table to hold deleted records) first.  I also need to change a field in the first table's parent.  So I find the record I'm looking for in the first table, then I see if it already exists in the deleted table.  Then I either create or update the deleted table record.  I update the field in the parent, call deleteObject on the record I want to delete, then save the changes.  Everything is working except the record I want to delete isn't getting deleted.  Here's my code:

Dim e = (From employ In context.prResumes
              Where employ.fileNum = sFile
              Select employ).FirstOrDefault
Dim d = (From delEmploy In context.delprResumes
              Where delEmploy.fileNum = sFile
              Select delEmploy).FirstOrDefault
If d Is Nothing Then
    .... create the record here ....
    e.Person.employment = False

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.

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.

Bar Code Scanners with the .NET Compact Framework

Summary: Learn how to make your applications use bar code scanners in a generic way-ndependent of the specific bar code scanners that are used on different devices. Using the design patterns Façade and Factory, the implementation not only supports multiple bar code scanners, but it also makes it easy to add support for other bar code scanners. After a brief discussion about bar code scanners and the bar code scanner pattern, a download code sample, written in C#, demonstrates the use of the pattern and technologies.

Serial Communication with the .NET Compact Framework

Learn how to make your applications communicate over a serial port and how to handle common issues when implementing serial solutions. After a general discussion about serial communication and a common serial communication standard, this article demonstrates a practical use of the technologies through sample source code written in C#.

.net 4 framework getelementbyid for javascript without clientid


I thought I heard we would be able to get the value of an asp:textbox by id with javascript in the .net 4 framework? was I mistaken? if not does anyone know the syntax?

Some basic MVC question

  1. In regular asp net I can run (debug) the application but I can either "view in browser" that gives me the option to view the application and write code on same time.

In MVC I can't find this option.

  1. What is the basic DATA MODEL for working with SQL DB.

I mean with no any framework (entity framework, Sub sonic, Link to SQL etc')

I look for basic application that works with data but with no fw.

  1. What is the popular DB framework that working with data.
  2.  I am looking on  mvc series


C# Soup To Nuts  (the best series ever)


I watch some of the MVC video, seems that the music store is good but I have to wait to the other part.

Does any one know and recommend   a Microsoft MVC tutorial?





Web Site to Web Application Question


I've been building web sites and for my next project I will be creating a web application.  I use a 'BasePage' class in all my projects but, since web applications do not contain the 'App_Code' folder, what is the best place/practice for the 'BasePage' class?



connection string question from a newbie


when publishing  in the webmatrix dialogue it asks for "destination connection string" for my "database.mdf"

I was not sure what it was so I pasted this from my web.config file :

Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\database.mdf;Integrated Security=True;User Instance=True

it all published ok, but wont run, so I guess it has somthing to do with this connection string or some kind of configuration issue.

My question is this, What should go in the field for "Destination connection string"

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