有没有办法以编程方式获得最新的变更集版本.
获取某个文件的变更集ID非常容易:
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("https://my.tfs.com/DefaultCollection"));
tfs.EnsureAuthenticated();
var vcs = tfs.GetService<VersionControlServer>();
Run Code Online (Sandbox Code Playgroud)
然后调用GetItems或QueryHistory,但我想知道最后一个签到号码是什么.
我问过几个人为什么在存储过程中使用xml作为参数不起作用而且每个人都说,这就是它的方式.我无法相信这一点.
command.Parameters.Add("@xmldoc", SqlDbType.Xml);
Run Code Online (Sandbox Code Playgroud)
这就是编译器返回错误的地方,我不能使用NVarChar beacouse它只限于4k唱歌.XML将是完美的,因为它可以是2gig大.
为什么其他SqlDbTypes运行良好,这个重新出错?
*
错误:指定的参数超出了有效值的范围.参数名称:@xmldoc:无效的SqlDbType枚举值:25.
*
我有一个表格,我想在鼠标移开时更改单元格背景和鼠标按钮,我当前的解决方案不能正常工作,因为我想要它:
function ChangeColor(sender) {
sender.style.backgroundColor = 'yellow';
}
var clicking = false;
$(document).mouseup(function() {
clicking = false;
});
$(document).ready(function() {
$('#Table1 tr').each(function() {
$('td', this).each(function() {
$(this).mousedown(function() {
clicking = true;
});
$(this).mousedown(function(event) {
if (clicking==true) { ChangeColor(this); }
});
});
});
});
Run Code Online (Sandbox Code Playgroud)
有没有办法让它像那样工作?
我使用包装器从表User获取一些数据
IQueryable<StarGuestWrapper> WhereQuery =
session.Linq<User>().Where(u => u.HomeClub.Id == clubId && u.IsActive).Select(
u =>
new StarGuestWrapper()
{
FullName = u.Name + " " + u.LastName,
LoginTime = u.SomeDateTime,
MonthsAsMember = u.SomeIntergerValue,
StarRating = u.SomeOtherInteregValue,
UserPicture = u.Photo.PhotoData,
InstructorFullName = u.SomeInstructorName,
TalkInteractionDuringSession = u.SomeBoolValue,
GoalInteractionDuringSession = u.SomeOtherBoolValue
});
Run Code Online (Sandbox Code Playgroud)
我使用它作为IQueryable没有问题所以我可以在实际运行查询之前做有用的事情.喜欢 :
WhereQuery.Skip(startRowIndex).Take(maximumRows).ToList();
Run Code Online (Sandbox Code Playgroud)
等等.
使用查询中的"where"语句会出现问题.例如:
WhereQuery.Where(s => s.StarRating == 1)
Run Code Online (Sandbox Code Playgroud)
将在运行时抛出异常,在User表中不存在'StarRating' - 当然它不是一个包装器属性.如果我实现查询,它将起作用
WhereQuery.AsEnumerable().Where(s => s.StarRating == 1)
Run Code Online (Sandbox Code Playgroud)
但是它失去了使用IQueryable的所有感觉,我不想这样做.
奇怪而有趣的是,并非所有属性都来自包装器抛出错误,所有bool值都可以在where语句中使用.示例:
WhereQuery.Where(s => s.TalkInteractionDuringSession)
Run Code Online (Sandbox Code Playgroud)
它在EntityFramework中工作,为什么我在NHibernate中得到这个错误以及如何让它以我想要的方式运行?
我一直在尝试找出类似Gmail的搜索的正则表达式,即:
name:Joe surname:(Foo Bar)
Run Code Online (Sandbox Code Playgroud)
...就像在本主题中一样。但有一点区别:如果文本中没有key:,它也会被拆分,因此:
foo:(hello world) bar:(-{bad things}) some text to search
Run Code Online (Sandbox Code Playgroud)
会返回:
foo:(hello world)
bar:(-{bad things})
some text to search
Run Code Online (Sandbox Code Playgroud) c# ×3
.net ×1
dom ×1
javascript ×1
jquery ×1
mouseevent ×1
nhibernate ×1
regex ×1
tfs-sdk ×1
tfs2010 ×1
xml ×1