Why can't I delete DataSources from my project? - winforms

So I am starting a new project with an existing database using Windows Forms. I am trying to use Entity Framework 4 and the steps I do are as follows:
New project->Windows Forms Application (for my front-end app)
Right-Click solution->Add->New Project->Class Library (used for DAL)
Now I want to add the entity model to the DAL and so I right-click on that project and go through the steps of adding the entity model in the wizard. When it gets done I have the .edmx file, references added and ALSO the DataSources folder with the .datasource file. I CAN'T remove this.
Why would I need that datasources in the DAL if I am intending to put a object datasource in my front-end?? Seems funny to have 2 projects each having the same datasources. I am trying to follow the steps in this article and when I load the source from that article for (Seperating data layer from UI Layer) it shows the Data sources only in his app, not the DAL.
Does part of adding a entity data model REQUIRE datasources? Why can't I delete it and move it to my application project?
I just tested the same steps on my laptop and it works as expected, only the .edmx is created and it doesn't throw in a datasources folder in the properties with a .datasource file.

It appears that if you choose Data->Show Data Sources VS 2010 automatically adds a datasources folder under the project and you CAN'T delete it until you close the data sources window
I couldn't post it until I waited for 8 hours :-(

Related

Moved Gui Builder form to another project and I can't open the Gui Builder now

I was working on a project and I wanted to reorganize the packages, and because of the weird behaviour Codename One has when refactor/renaming GuiBuilder forms, I decided to create a new project and move those forms to the new project with the proper package organization, but now the Gui Builder won't open because it "doesn't recognize" them as Gui Builder's forms. Any fix so I dont have to create every form again?
The GUI builder forms are really two files:
A Java File
An XML gui file
You need to move both and keep both in the exact same hierarchy!
You can find the latter under the res/guibuilder hierarchy in your project.

Silverlight Entity Framework don’t load Model when I click on .EDMX file in Solution Exporer?

I am trying to load data in to datagrid of SilverLight using Entity Framework and WCF Service.
For that I have followed the article overe here http://geekswithblogs.net/PeterTweed/archive/2009/07/01/a-simple-silverlight-crud-application--part-1-putting-the.aspx
But problem Is when I have added .edmx file and click on the “Model.edmx” in solution explorer it doesn’t shows me model but instead of that it shows me message as per below image.
And in Mapping Detail window shows me the message as per below image…instead of Mappings of my database table field and class.
Thank You so much........
Check whether tables you have created has primary key or not, because without creating PK for table, EDMX might not show tables model or mapping...

WIn Forms loading labels from resx file

I'm creating a windows forms application. I have all of my resource strings (resx files) in its own project within the solution. Is it possible to reference those resource files at design time?
Coming from web (ASP.Net MVC) we were able to add a reference in the view to the resource file(s) we needed. Am I able to do something similar and set the labels at design time?
Not unless you are prepared to go down the route of using Localizable forms - see WinForms strings in resource files, wired up in designer

How do I recreate this design of silverlight?

I have a silverlight sample code that looks like this simple design of just an APP and a PAGE file. I want to recreate this sort of setup from scratch to create a project that ouputs a silverlight program yet it only has these couple of files along with some support files. I went through the creation of a number of Silverlight creations and none produced such a simple and small design. How do I create such a formation that is just an App and a Page and such a few additional files from scratch and still have it output as a silverlight app?
First of all, to create this kind of project - I see you are using Visual Studio 2010, simply go to : file-new-project. On the left window there should be a tab for the templates. Select Silverlight (it will be under Visual C#). In the main window, select "Silverlight application". Once you named your project and click ok, you will be prompted on whether to host the page in a new website. Untick the checkbox and click ok. Now you will have your project exactly as it looks in your image.
Just note though, as you run it in VS, it will automatically generate a page for the app to run in, but since you indicated that it should not create a website to host it in, when wanting to deploy, you will have to create your own page and add the required markup yourself.

RIA Services - Two entity models share an entity name

I have two entity models hooked up to two different databases. However, the two databases both have a table named 'brand', for example. As such, there is a naming conflict in my models. Now, I've been able to add a namespace to each model, via Custom Tool Namespace in the model's properties, but the generated code in my Silverlight project will try to use both namespaces, and come up with this,
Imports MyProject.ModelA
Imports MyProject.ModelB
Public ReadOnly Property brands() As EntitySet(Of brand)
Get
Return MyBase.EntityContainer.GetEntitySet(Of brand)
End Get
End Property
giving me this exception:
'Error 1 'brand' is ambiguous, imported from the namespaces or types 'MyProject.ModelA,MyProject.ModelB'.
Has anyone had experience with naming conflicts like this using RIA services? How did you solve it?
Found the solution.
Unload the client (Silverlight) project.
Right click the unloaded project and edit the .csproj or .vbproj file.
Add <RiaClientUseFullTypeNames>true</RiaClientUseFullTypeNames> inside the <PropertyGroup> tag
Reload project. Do a full rebuild.
Now the generated code will use full type names (i.e., MyProject.ModelA.brand)

Resources