草庐IT

max_entries

全部标签

c# - Entity Framework - "An error occurred while updating the entries. See the inner exception for details"

这个问题在这里已经有了答案:FindingthereasonforDBUpdateException(9个回答)关闭3年前。我有问题,我刚开始学习EFModelFirst,我在一个点上停留了一段时间。我收到这样的错误:“更新条目时发生错误。有关详细信息,请参阅内部异常”我在图表上创建了一个简单的模型,生成了数据库并用C#编写了简单的代码以在表格中只添加一行,但错误一直出现。我发布了带有Diagram/GeneratedDLL/SimpleMain/Anderrorthrowing的截图更大尺寸的链接:http://i.imgur.com/bKGc4wv.png

c# - Linq distinct 和 max

我必须查询这个表:symboltime----------------aaa2013-04-1809:10:28.000bbb2013-04-1809:10:27.000aaa2013-04-1809:10:27.000bbb2013-04-1809:10:26.000对于具有最大时间值的所有不同符号,我需要一行。我必须如何编写我的linq查询?提前致谢 最佳答案 按符号对行进行分组,然后用最大时间从每个组项中进行选择(表是上下文中的数据库表名):fromrinTablegrouprbyr.symbolintogselectg.Or

c# - "Compile with/main to specify the type that contains the entry point."

根据下面的代码,我收到以下消息。我相当确定我得到它的“原因”,我只是不知道如何重新排列代码以移动/删除/替换导致错误的语句之一。“使用/main编译以指定包含入口点的类型。”"staticvoidMain(string[]args)"下有一堆代码,我从http://support.microsoft.com/kb/816112为了从自动递增中获取ID,所以当其余代码填充Access数据库时,我可以让它自动递增。任何帮助表示赞赏。也欢迎使用更简单的代码获得结果的建议!namespaceWindowsFormsApplication1{publicpartialclassForm1:For

c# - Fluent nHibernate 自动映射属性为 nvarchar(max)

使用流畅的nhibernate和自动映射(nhibernate创建我的数据库模式),我如何让nhibernate根据以下类在数据库中创建nvarchar(max)列publicclassVirtualPage:BaseEntity{publicvirtualintParentId{get;set;}publicvirtualstringPageName{get;set;}publicvirtualstringTitle{get;set;}publicvirtualstringBody{get;set;}publicvirtualstringViewName{get;set;}publi

c# - LINQ- Max where 条件

我有一个定义如下的TaskWeekUI类:publicclassTaskWeekUI{publicGuidTaskWeekId{get;set;}publicGuidTaskId{get;set;}publicGuidWeekId{get;set;}publicDateTimeEndDate{get;set;}publicstringPersianEndDate{get;set;}publicdoublePlanProgress{get;set;}publicdoubleActualProgress{get;set;}}我写了这个查询:TaskWeekUIti=tis.First(t=

c# - 表达式树 - Math.Max 替换

当我使用表达式树来替换一个方法时,比如Math.Max,看起来它在表达式树中成功地替换了它。但是当我在EntityFramework中使用它时,它抛出一个关于EntityFramework不支持Math.Max的异常。但我明确地替换了它。有人知道为什么吗?以及修复代码的方法?usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Linq.Expressions;namespaceConsoleApplication1{publicstaticclassCalculateDatabase{publ

c# - 当属性等于 Max 和 NHibernate 时选择对象

我们有一个查询,它根据另一个值选择行,即。最大值我认为这没有多大意义,所以这里是查询:vardeatched=DetachedCriteria.For("e2").SetProjection(Projections.Alias(Projections.Max("Property"),"maxProperty")).Add(Restrictions.EqProperty("e2.EnquiryCode","e.EnquiryCode"));session.CreateCriteria(typeof(Enquiry),"e").Add(Subqueries.PropertyEq("Prop

c# - EF4 将 varbinary(max) 映射到二进制 - 代码优先错误

我有一个名为Attachment的POCO类,它映射到SqlServer中的一个表,其中有一个VarBinary(max)字段。该字段包含文件。POCO类看起来像这样publicclassAttachment{publicstringAttachmentId{get;set;}publicstringAttachmentTypeId{get;set;}publicstringTitle{get;set;}publicstringText{get;set;}publicBinaryData{get;set;}}映射看起来像这样modelBuilder.Entity().Property(

c# - Youtube 数据 API : Retrieving multiple Video entries by IDs in a single request

我想知道是否有办法在YouTube上查询多个随机单个查询中的视频(视频ID已知)?我将视频ID存储在本地数据库中,需要显示多个网页中的详细信息(带有拇指、评分、作者姓名等的列表)。我正在查看Youtube数据API,发现我可以像这样的实体数据:UrivideoEntryUrl=newUri("http://gdata.youtube.com/feeds/api/videos/video_id");Videovideo=request.Retrieve(videoEntryUrl);在循环中重复这个似乎是个坏主意,因为配额。还有“批处理”可用——http://code.google.co

c# - 如何在 CLR UDF 中返回 nvarchar(max)?

假设如下定义://////ReplaceseachoccurrenceofsPatterninsInputwithsReplace.Thisisdone///withtheCLR:///newRegEx(sPattern,RegexOptions.Multiline).Replace(sInput,sReplace).///Theresultofthereplacementisthereturnvalue.///[SqlFunction(IsDeterministic=true)]publicstaticSqlStringFRegexReplace(stringsInput,strin