Hi,
The following code is generating a runtime error and I have no idea why.
from o in Orders
group o by o.Employee into employeeOrders
select new {
employeeOrders.Key.EmployeeID,
employeeOrders.Key.FirstName,
Orders =
from eord in employeeOrders
orderby eord.OrderID
select new {
eord.OrderID,
eord.OrderDate,
OrderTotal=eord.OrderDetails.Sum (od => od.UnitPrice)
}
}
The error is
Member access 'System.Decimal UnitPrice' of 'LINQPad.User.OrderDetails' not legal on type 'LINQPad.User.Orders
I've also tried this in VS2010 with a standard drag and drop data context and same thing.
Thanks in advance
Hi,
I have my views and layouts split into multiple partials, some of them are static partials i.e, no data from the database being displayed here. Does it make sense to cache these to prevent the erb templating system from generating the html each time or it only makes sense to cache in situations where something needs to be retrieved from the db each time.
thanks,
ash
Is there any way to to setup Rails generating files with tabs instead spaces?
Or maybe is there any way to auto replacing spaces to tabs in gedit?
Cause I really prefered tabs and it's really take some time to replace spaces to tabs in new generated files by Rails.
Thanks in advance!
Hi,
Is it possible to generate word documents (*.doc) in java web application using Eclipse BIRT (Report Engine)? I want .rptdesign to be an input file in generating process. I could not find any example or tutorial.
What would you recommend as an alternative solution. As far as I know Jasper Reports allow only RTF format generation.
Thank you for your answer/explaination
Hey SO,
I've got a pretty noob question for ya. I keep seeing this syntax:
<%= Html.LabelFor(model => model.Email) %>
...and I have no idea what the = means. I thought it was syntax for linq2sql or ado.net entity framework but I'm just using straight ado.net. I don't understand why the VWD used that syntax when generating the Create form.
What does = mean?
Is it possible to read HTML Web 2.0 Source Code that is dynamically generated ?
The Perl LWP with its agent-response does not pick up any dynamically generated HTML code.
Many websites today are generating dynamic html. If I am shoppping for best prices, and the prices are dynamically fetched and dumped, then I am out of business.
Are we reaching the end of a era?
I have been messing with hash functions and functions to generate primes etc.
I had 3 lock-ups in a short period. This was odd since my macbook rarely locks-up and usually only when I run out of memory - which does not happen often.
But in this case, I had three in a row and none since (but I also am not generating as much load as before).
I am feeling problem when generating .pdf file from excel2007(.xlsx) file using code like excelWorkBook.ExportAsFixedFormat(paramExportFormat,
paramExportFilePath, paramExportQuality,
true, false, paramMissing, paramMissing, paramOpenAfterPublish,paramMissing);
THe generated pdf having chart image show with border on XP 2003 server
so it cut some other part. Which not come if generated locally on xp system.
I am trying to think of an elegant way of getting a random subset from a set in F#
Any thoughts on this?
Perhaps this would work: say we have a set of 2x elements and we need to pick a subset of y elements. Then if we could generate an x sized bit random number that contains exactly y 2n powers we effectively have a random mask with y holes in it. We could keep generating new random numbers until we get the first one satisfying this constraint but is there a better way?
Is there a way to force the MVC automatically generated code to follow the conventions you have set in your preferences? For example, I keep all curly braces on the same lines as their declaring class, method, etc, but when generating a controller, it completely disregards my settings. Is there a setting someplace to force the same code generation as other parts of project?
Hi,
I have developed mailserver using postfix. I used mailgraph for generating the daily, weekly, monthly, yearly reports. But I want to make reports of mail which has sender, recipient, subject, etc.
What should I do?
Please help me....
I just read a blog post about NHibernate's ability to create a GUID from the system time (Guid.Comb), thus avoiding a good amount of database fragmentation. You could call it the client-side equivalent to the SQL Server Sequential ID.
Is there a way I could use a similar strategy in my Linq-to-Sql project (by generating the Guid in code)?
I am generating an areachart and i need to mark the nodes where values exists at corresponding x and y , but the data tip should not appear. Only presence of mark to indicate the value exists at that particular point is enough, how can it be done?
Hi,
while(((long)(1000*ratio*((long)clock()-(long)t0))%100)/1000)<Data_Read_Rate);
The above line is generating the following error:
"Syntax Error before < token".
Why is this error coming up?
I use MINGW32 for development(GCC compiler).
Thanks...
I noticed that doxygen uses the graphviz library for creating diagrams. Have you ever used graphviz for generating documentation? Is it worth learning the graphviz for documentation purposes outside the scope of doxygen? Or am I better off to sticking with a standard data modeling package like Visio?
I understand the merits of it as a graphing library, but for trying to represent more complex UML (or similar) is it still worth looking into?
Edit 3:
After more googling it looks like you can't have the TargetFrameworkMoniker property in a .NET 3.5 application. So I guess I should be asking a different question.
How do I change the Target framework from 4.0 to 3.5? Unfortunately, I can only find stuff on how to go the other way. or better yet how do i progrommatically set the target framework version of a project to something other than 4.0?
Original question:
I just switched to vs2010. I have an application that uses .net 3.5. It loads plugins which are generated by a different app. The plugins are using .net 4 and there for cannot be loaded. I'm using EnvDTE.Project to create a project and set the settings. I can't find what setting needs to be set for this.
Edit 1:
I'm generating code for about 50 solutions. When I made the switch from vs2005 to vs2010 the projects in those solutions are defaulting to .NET Framework 4.0. So I need to set the .NET Framework to 3.5 when I am generating the code for these solutions.
Edit 2:
After a lot of googling I found this. so then I tried this:
loProp = vsGetProperty("TargetFrameworkMoniker");
vsSetValue(loProp, ".NETFramework,Version=v3.5");
the definitions for those two methods are below. as far as I can tell they do the same this as
project.Properties.Item("TargetFrameworkMoniker").Value = ".NETFramework,Version=v4.0,Profile=Client";
I start getting an Property Unavailable Exception later in the code. When I remove the new lines everything works except the projects target framework is still 4.0.
The code generators target framework is 3.5 so I can't use the FrameworkName class like shown in the second example in that link.
here is vsGetProperty
protected Property vsGetProperty(string aProperty)
{
bool lbDone = false;
int liCount = 0;
Property loProp;
while (!lbDone && liCount < pMaxRetries)
{
try
{
loProp = pProject.Properties.Item(aProperty);
lbDone = true;
return loProp;
}
catch (System.Runtime.InteropServices.COMException loE)
{
liCount++;
if ((uint)loE.ErrorCode == 0x80010001)
{
// RPC_E_CALL_REJECTED - sleep half sec then try again
System.Threading.Thread.Sleep(pDelayBetweenRetry);
}
}
}
return null;
}
and vsSetValue
protected void vsSetValue(Property aProperty, string aValue)
{
bool lbDone = false;
int liCount = 0;
while (!lbDone && liCount < pMaxRetries)
{
try
{
aProperty.Value = aValue;
lbDone = true;
}
catch (System.Runtime.InteropServices.COMException loE)
{
liCount++;
if ((uint)loE.ErrorCode == 0x80010001)
{
// RPC_E_CALL_REJECTED - sleep half sec then try again
System.Threading.Thread.Sleep(pDelayBetweenRetry);
}
}
}
}
Hi Guys,
I have just updated my nant script to compile my .net framework 4 solution.
And I got the above error while generating commonassemblyinfo.cs in my solution.
I visited msdn website and also added that line :
in my web.config under runtime-configuration.
But that didn't solve my problem.
Can anyone please suggest what am I missing?
Hello all ,
URL u=new URL("telnet://route-server.exodus.net");
This line is generating :
java.net.MalformedURLException: unknown protocol: telnet
And i encounter similar problems with other URLs that begin with "news://"
These are URLs extracted from ODP , so i dont understand why such exceptions arise..
Given that I am generating an exe application with AssemblyBuilder, how do I set an icon to it?
I think I should be using
System.Reflection.Emit.AssemblyBuilder.DefineUnmanagedResource
Is there an example how to do it?
When is it a good idea to use PHP_EOL? I sometimes see this in code samples of PHP. Does this handle DOS/Mac/Unix endline issues? Most of the PHP I write is for generating HTML, and I use <br/> instead of actual newlines, so haven't used this constant before.
I have a large graph that I am generating in matplotlib. I'd like to add a number of icons to this graph at certain (x,y) coordinates. I am wondering if there is any way to do that in matplotlib
Thank you
I am generating a dynamic HTML table string and displaying inside a div. I am assigning ID and runat server in that string. eg.
string s="<table id='tblAll' runat='server'></table>".
This string is generated on some different page, and its passed as XmlhttpResponseText
I want to apply sorting on this table, It would be great if any one can help me out.
Thanks
I am generating large PNG files from a Scala program. Currently, I am doing it the same way I would do it in java. I am creating a new BufferedImage and setting each pixel to the correct color. This works fine, but I am wondering if there are any good libraries for working with images in Scala? I am looking for something like Ruby's RMagick library.
here's my code:
XmlDocument doc = new XmlDocument();
foreach (string c in colorList)
{
doc.Load(@"http://whoisxmlapi.com/whoisserver/WhoisService?domainName=" + c + @"&username=user&password=pass");
textBox1.Text += doc.SelectSingleNode("WhoisRecord/registrant/email").InnerText + ",";
}
for the second line of code (textbox1...) is generating this error
what am i doing wrong?