populate a formview using linq - vs2010 c# - visual-studio-2010

Using Linq I have built a query which I return to a gridview.
This works fine but I want to populate a formview with the same data,
can anyone point me to a decent how-to article please?
thanks

Try to assign your query result to a DataSource property, then try to execute DataBind() method.. it should work.. if not, please provide us some code...
Regards..

Related

Missing SQL view in geoserver

At the moment I'm trying to make an SQL view in geoserver, however I do not have the option to make an SQL view. see picture below.
Anyone else who has had problems with this issue? I can't find any documentation how to fix this problem so help will be appreciated!
Thanks for responding, it was a shapefile source so that was the reason it is not possible. For the people who come to this post with the same question, the datasource .SHP does not support SQLviews on geoserver. There are two possible solutions for this: 1) change your data source to a dbs like postgres. 2) Use CQL filter instead directly in your code!

Odata v4 orderby expand webapi

so I am using webapi with the latest version of odata
I am trying to sort and filter my expand,
http://services.odata.org/V4/Northwind/Northwind.svc/Orders?%24select=OrderID&%24expand=Order_Details(%24select=UnitPrice;%24orderby=UnitPrice%20desc)
not getting any errors as the data comes back with no issue, however the the orderby inside of the expand dose nothing.
is this sort allowed?
if not do you know of a workaround?
thanks
This is not supported yet, see this issue to track the progress. https://github.com/OData/WebApi/issues/557

View [Me] in sharepoint 2013

I'm trying to filter a document library for the logged user.
I've a column person type and i tryed to use [Me] in the filter but without result.
If i look inside [Me] i've #%<~
Do you have a solution to do this?
Thanks

Sample of how to create and save new entity, Breezejs

Im trying to create a very basic Todo-entity from the Breeze example.. Im doing:
manager.createEntity("Todo",{Description:"Test",Id:32,IsDone:false});
But I keep getting an error where the console tells me that it couldnt find the Type "Todo".. I have tried all types I can possibly think of..
Could anyone please provide me with an example of how to create an entity for the breeze WebApiSample.. cause this is driving me nuts..
Thanks alot!
Breeze needs metadata in order to create an entity of any type. That metadata can either be returned from the server or created locally. My guess is that you haven't yet done either of these. Metadata from the server is usually automatically fetched by Breeze during its first query against the server. Alternatively you can cause it to be fetched directly via the MetadataStore.fetchMetadata method.
Hope this helps.

How do I trace a linq query when using PredicateBuilder/AsExpandable?

I am using PredicateBuilder, which means that I am using the AsExpandable extension method. The problem is that I can no longer Trace my SQL queries as the following error is thrown when I try to cast the query to ObjectQuery so that I can do a ObjectQuery.ToTraceString() call on it...
Unable to cast object of type 'LinqKit.ExpandableQuery`1[Genesis.Person]' to type 'System.Data.Objects.ObjectQuery'.
Any Ideas?
I would recommend running a Dump() on your query in LINQPad, and using the SQL tab to see what SQL was generated. Do do this, hook up LINQPad to your Entity Framework context, press F4 to include a reference to LinqKit.dll, and LinqKit as a namespace import. Let me know if you need additional guidance in how to do this.
Use the following universal PredicateBuilder instead of LinqKit:
http://petemontgomery.wordpress.com/2011/02/10/a-universal-predicatebuilder/
Then ObjectQuery.ToTraceString() will work as expected.
I'm not familiar with your precise problem but can you not run the trace on the SQL server instead using (eg profiler assuming MSSQL) ?
This would still allow you to see the executed queries and you could restrict it to be just your machine that is recorded...

Resources