我正在尝试为我正在使用的本地数据库创建数据库脚本工具.
我已经能够为表,主键,索引和外键生成创建脚本,但我找不到任何方法来为表默认值生成创建脚本.
对于索引,它就像
foreach (Index index in table.Indexes)
{
ScriptingOptions drop = new ScriptingOptions();
drop.ScriptDrops = true;
drop.IncludeIfNotExists = true;
foreach (string dropstring in index.Script(drop))
{
createScript.Append(dropstring);
}
ScriptingOptions create = new ScriptingOptions();
create.IncludeIfNotExists = true;
foreach (string createstring in index.Script(create))
{
createScript.Append(createstring);
}
}
Run Code Online (Sandbox Code Playgroud)
但Table对象没有Defaults属性.是否有其他方法为表默认值生成脚本?
到目前为止,我在javascript中做得不多.我最近开始玩jQuery并且遇到了关于如何在表单上进行编辑的教程.
如果你在函数中对容器div的id进行硬编码,那么生成的代码就可以完美地运行,但是我在将这个代码推广到传递给函数的id时遇到了问题.
代码如下所示:
$(document).ready(function() {
setClickable($('#editInPlace'));
});
function setClickable(target)
{
$(target).click
(
function()
{
//Do some dom manipulation
$('.buttonA').click(function() { saveChanges(this, false); });
$('.buttonB').click(function() { saveChanges(this, true); });
}
)
.mouseover(function() { $(this).addClass("editable"); })
.mouseout(function() { $(this).removeClass("editable"); });
}; //end of function setClickable
function saveChanges(obj, cancel)
{
//Handle the save changes code
//Reset the div
$(obj).parent().after('<div id="editInPlace">' + t + '</div>').remove();
//Call setClickable
setClickable($('#editInPlace'));
}
Run Code Online (Sandbox Code Playgroud)
我遇到问题的部分是setClickable
对saveChanges
函数内部的最后一次调用.如果我对其值进行硬编码$('#editInPlace')
,则可以正常工作.但是,如果我将功能签名更改为
function saveChanges(target, obj, cancel) …
Run Code Online (Sandbox Code Playgroud) 在执行查找后,ruby/rails是否可以对结果集进行排序?例如,是否可以做这样的事情
警告:不起作用
if type == 1
@items = mycompany.items
else
@items = myhome.items
end
@items = @items :order => "created_at"
Run Code Online (Sandbox Code Playgroud)
我会假设这样的事情应该是可能的,但我仍然是RoR的新手,似乎无法在谷歌上找到任何东西.
有没有一种简单的方法可以将整个Access文件(.mdb)读入.NET中的DataSet(特别是C#或VB)?
或者至少从访问文件中获取一个表列表,以便我可以循环遍历它并一次一个地添加到DataSet中?
.net ×1
activerecord ×1
bayesian ×1
c# ×1
dataset ×1
javascript ×1
jquery ×1
ms-access ×1
nlp ×1
ruby ×1
smo ×1
sql-server ×1
tagging ×1