I have created a WCF Data Service (v5.6.0) based on a (model-first) Entity Framework (v5.0) model. I created a new/fresh model to be sure to have all 'defaults' in place (also tried disabling lazy loading but didn't help).
Working
I can now create a Service Reference in a test application (Windows application). From code I can use the generated proxy as if it is the actual model. I can query the data. So far so good.
Wish
However what I would like is to bind my WCF service to a data bound control, e.g. a DataGridView. For this we would like to use the Visual Studio designer so that we can select columns and so on.
Bug?
What I do for this is I click the arrow of the control and then use the "Choose Data Source" dropdown to select "Add Project Data Source" and then select "Service" to create a new service reference. This works without errors. However no data source is created and when I select the arrow again and go to "Choose Data Source" I see absolutely no data source. Also no errors. It gracefully fails.
Am I missing something obvious or is this a bug? Any help will be appreciated.
tnx!
Related
Here is the scenario. Two networks need to talk to eachother. I have an app that has a local database in our environment that the app talks too. It is using bound controls on a datagrid using vb.net. Now we want to move the database to the other network and the only way we can have access is this network is using web services. I have a datagrid that is bound to a database and employee table. The vb.net code using the fill function and dataset embedded sql to display. The save function has code such as me.validate() and .endedit() and then uses the update method to update the database from the grid. I need to strip this out and put it in web methods. What is the easiest way to do this. I know the fill is basically a select statement i can retrieve and return a datatable from the web service, but what would be the easiest way to save from the web method. any ideas would be appreciated. unfortunately this is the way it has to be from the network standpoint.
I am following an msdn walkthrough for creating an RIA services solution with Silverlight. Here is the article link. I have followed at least 4 other articles and found like a dozen more over internet but all of those create edmx from SQL server. In my case, I have to use Oracle in backend, so I have created the data model through Oracle Development Tool, Oracle Provider for .Net.
After generating the edmx and building everything,
I move on to create a domain service class to use the classes in silverlight project, but for some reason the context class doesn't load in the dropdown where it should.
A sample class generated by the edmx looks like this
I have been trying to do this for a week now, and after having been tried for half a dozen times, I need help.
If you are using Visual Studio 2012 have a look here:
http://support.microsoft.com/kb/2745294
In summary:
Open your entity model in the designer (If needed, click in the "white space" of the designer to ensure no objects within the model are selected)
In the Properties window, change the "Code Generation Strategy" from "None" to "Default"
Delete the two ".tt" files that are adjacent to the model, with the assumption that you have not modified these files beyond their original state when the entity model was created. If you have modified these files, then customizations to your entity model will be lost.
Rebuild the project
Linqpad v4.26
This process works great on my Dev box. I hand copied to the end-user install folder linqpad.exe, linqpad.exe.config, custom.dll, system.data.sqlite.dll and system.data.sqlite.linq.dll.
I create a connection, click radio button Use a typed data context form your own assembly. Select Entity Framework, Select Next, Browse to my custom dll. Choose Provider radio button to other. System.Data.SQLite is not in the drop down.
I ran the sqlite setup-bundle installer on my Dev box in order to get sqlite installed in the GAC to support VS2010 designer.
Thanks,
John
The dropdown that shows database providers is populated with System.Data.Common.DbProviderFactories.GetFactoryClasses(). If SQLite is not listed, then it hasn't been registered in the machine.config. However, LINQPad doesn't stop you from entering the name of the provider manually, as you would in constructing an Entity Framework connection string.
+1, because even though I can see it in the drop down it doesn't appear to be valid.
I have now done the following to no avail:
Ran sqlite-netFx40-Setup-x86-2010-1.0.82.0.exe on the client machine.
Copy/pasted from the readme.htm sections into the Linqpad.exe.config file.
Copied the System.Data.SQLite.dlls from Program Files\System.data.sqlite to the app dir where I installed Linqpad.
Fired up linqpad selected my custom provider. It shows all of the tables but as soon as I try and run any query I get exceptions.
I have a SQL Server CLR trigger project that was created in VS2008. Opening the project in VS2012 does not present any problem, but on build of the solution, I get SQL71501 errors, with Trigger: [...] has an unresolved reference to object [...].
Based on my reading, this is due to a missing database reference in the project. When I try to add a database reference, I get the Add Database Reference dialog that gives me three options:
Database projects in the current solution ** this option is grayed out/disabled
System database (only shows system DBs)
Data-tier Application (.dacpac) ** there are no options to select as this was not how I created the project.
Further reading suggested that the reason there are no database projects to select for the first option, is because no Data Connections have been added via the Server Explorer. In my case there are certainly Data Connections present, and while my project is open, I can quite happily browse the database, look at data etc.
I thought it might have something to do with the Target Framework, so I have tried targeting 3.5 and even 2, but the same problem occurs.
I feel like I'm missing something fundamental, but just can't quite work it out. Any help would be GREATLY appreciated.
I've seen this dialog not enable the 'OK' button because the Database Variable that it defaults is invalid (in my case it had a '.' in it).
The clue to this being the error is that the text in the 'Example Usage' field contains the error message - it's just hard to see as it's dark grey on light grey.
Editing the Database Variable name fixes this.
I found a workarroud for this, isn't optimal but at least it works:
try this
- open sql server object explorer
- create a new connection to your server
- right click on the database and select create new the project...
- the wizard will create the project with all the references and connection string attached to it.
cheers!
I changed my answer
The problem is you cannot assume an insert is a single row and you can really only reference the primary key as a single value inside the trigger
I am creating a silverlight 4 project (with web site). When I try to add a data source to the project, I dont see database option in the list of options. There are only "service", "object" and "sharepoint" options. But there is no "database" option there. So I am not able to bind to database at design time.
I want to know what is the reason and why it is like that, is something not installed or any configuration mistake?
Can somebody pls tell me.
I am using Visual studio 2010 Professional.
Thanks