我有一个表单,我有几百个文本框,我想在加载时删除任何逗号,并防止输入逗号.假设选择器是正确的,跟随代码不应该工作吗?
$(document).ready(function () {
$("input[id*=_tb]")
.each(function () {
this.value.replace(",", "")
})
.onkeyup(function () {
this.value.replace(",", "")
})
});
Run Code Online (Sandbox Code Playgroud) 我在我的数据库服务器上有一个实用程序数据库(客户),我存储了用于修改其他数据库上的数据的所有例程.我们最近发现使用同义词会使我们受益匪浅.
use Customers
IF EXISTS (SELECT * FROM employees.sys.synonyms WHERE name = 'tblPerson2') begin
drop synonym [dbo].tblPerson2
end
Run Code Online (Sandbox Code Playgroud)
这不起作用,因为我使用的是Customers数据库,但需要从我的employees数据库中删除同义词.
SQL Server 2008不支持此语法 -
drop synonym [employees].[dbo].tblPerson2
Run Code Online (Sandbox Code Playgroud)
任何人都对如何修改数据库中的同义词有任何想法.我的解决方案涉及必须向每个数据库添加相同的存储过程,这似乎容易出错.
我们有一个表为NULL或"Accepted"作为值.我的查询返回大约250行.
如果我添加一个where条件 -
AND Description = 'Accepted'
Run Code Online (Sandbox Code Playgroud)
我的250行在2秒内返回.
但是,如果我添加一个where条件 -
ISNULL(Description, '') = 'Accepted'
Run Code Online (Sandbox Code Playgroud)
我的250行在47秒内返回.
有没有人遇到使用ISNULL功能的性能问题?不幸的是,我在程序上仅限于此时必须使用ISNULL.
这是我的代码:
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = true;
using (client as IDisposable)
{
foreach (MailAddress addr in Addresses)
{
if (addr != null)
{
try
{
message.To.Clear();
message.To.Add(addr);
client.Send(message);
}
catch (Exception ex)
{
Log(ex);
}
i++;
}
}
}
Run Code Online (Sandbox Code Playgroud)
每隔100秒,我就会记录一条消息
操作已超时.
这是客户端设置还是实际的邮件服务器?
在尝试合并 Microsoft CRM 中的联系人时,我使用了以下代码 -
//c1ID and c2ID are GUIDs of duplicated contacts.
EntityReference target = new EntityReference();
target.LogicalName = Contact.EntityLogicalName;
target.Id = c2ID;
MergeRequest merge = new MergeRequest();
// SubordinateId is the GUID of the account merging.
merge.SubordinateId = c1ID;
merge.Target = target;
merge.PerformParentingChecks = true;
Contact updater = new Contact();
Contact updater2 = new Contact();
updater = (Contact)xrmSvc.ContactSet.Where(c => c.ContactId.Equals(c1ID)).First();
updater2 = (Contact)xrmSvc.ContactSet.Where(c => c.ContactId.Equals(c2ID)).First();
MergeResponse mergedR = (MergeResponse)xrmSvc.Execute(merge);
Run Code Online (Sandbox Code Playgroud)
当我在这里尝试执行 Execute 调用时,出现此错误 -
无法在列集中为检索指定子属性。属性:所有者名称。
我没有正确设置吗?
这是我的代码 -
var obj = $('[id$=ddlInsert4]')
obj.disable = true;
Run Code Online (Sandbox Code Playgroud)
obj是一个下拉列表,但禁用调用不会禁用下拉列表.
alert(obj.val()) //this returns the correct value
Run Code Online (Sandbox Code Playgroud)
由于我的警报返回正确的值,我知道我的jQuery语法是正确的.我错过了什么?
所以,我有两个JavaScript函数:
function Generate() {
//Do something
$.ajax({data:{Svc: 'cpMain',
Cmd: 'Generate'
},
dataType: "text",
context: this,
success: genSuccess()
});
}
function genSuccess() {
//Do something
}
Run Code Online (Sandbox Code Playgroud)
在我的c#中,Page_Init()我从我的AJAX回调中获取参数来做某事.
我想订单Generate(),回调,genSuccess().但是,在此运行的顺序是Generate(),genSuccess()回调.
我错过了什么吗?