我已经安装了SQL Server 2008 express并通过windows身份验证登录,它不允许我做任何事情.如何在我的本地计算机2008快递中更改"sa"密码或获得完全权限?我正在使用Windows 7.
在我的Rails项目中,我试图在不同的端口运行两个不同的服务器.但它在控制台上出现此错误失败了.
C:\Rails>rails s
=> Booting Mongrel
=> Rails 3.1.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
A server is already running. Check C:/Rails/tmp/pids/server.pid.Exiting
Run Code Online (Sandbox Code Playgroud)
请检查更新的答案.
在这里,我试图从MS-SQL Server 2008
Ubuntu 10上的Rails应用程序中获取数据.但是我无法安装tiny_tds
.我按照github给出的步骤进行操作.但没有回应.请指导我正确设置.
二手gem命令:: gem install tiny_tds
这个命令也是:: gem install tiny_tds –with-freetds-include=/usr/local/include/freetds –with-freetds-lib=/usr/local/lib
错误:
Installing tiny_tds (0.4.5) with native extensions /home/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/home/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180@rails3/lib ... no
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180@rails3/lib/freetds ... no
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180@global/lib ... no
looking for library directory /home/.rvm/gems/ruby-1.9.2-p180@global/lib/freetds ... no
looking for library directory /home/.rvm/rubies/ruby-1.9.2-p180/lib ... yes
checking for main() in …
Run Code Online (Sandbox Code Playgroud) 我有我的Ajax工作,内置Rails javascript,提交按钮.但是,当我更改下拉框的值并取消按钮时,我希望它提交.在我的研究中,我发现了什么看起来是正确的解决方案,但我没有得到服务器的请求.这是我的下拉表单代码,请注意它在我添加之前仍然有提交按钮:onchange:
<% form_tag('switch_car', :method => :put, :remote => true) do %>
<div class="field">
<label>Car Name:</label>
<%= select_tag(:id, options_from_collection_for_select(active_cars, "id", "name"),
:onchange => ("$('switch_car').submit()"))%><%= submit_tag "Switch Car" %>
</div>
<% end %>
Run Code Online (Sandbox Code Playgroud)
这是生成的HTML:
<form accept-charset="UTF-8" action="switch_car" data-remote="true" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓" />
<input name="_method" type="hidden" value="put" />
<input name="authenticity_token" type="hidden" value="PEbdqAoiik37lcoP4+v+dakpYxdpMkSm7Ub8eZpdF9I=" />
</div>
<div class="field">
<label>Car Name:</label>
<select id="id" name="id" onchange="$('switch_car').submit()">
<option value="9">Truck</option>
<option value="10">Car</option>
</select>
<input name="commit" type="submit" value="Switch Car" />
</div>
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助.
我们知道任何表的id都是整数类型,并且该表中的自动递增很好.但我的问题是我想增加字符串和整数的组合.例如String:ABC是唯一ID的起始代码.
我的表的第一个ID应该是主键和
即ABC10001,ABC10002,.....等.
不使用其他键作为自动增量.请不要使用两种类型的唯一键.
我想到了一个新的想法.有人可能已经实现了这一点.我试图找到一种方法在下拉列表中添加一个文本框.
意味着我想在下拉列表中添加一个输入框.例如 :
<select id='country'>
<option value='USA'>USA</option>
<option value='UK'>UK</option>
<option value='Russia'>Russia</option>
<option><input type='text' /></option> // Here I want to add dynamic country
using ajax but I am able to render
this dropdown.
</select>
Run Code Online (Sandbox Code Playgroud)
有没有人知道如何执行此操作?我不想在此下拉列表外使用任何模态框或输入框.我只想在下拉列表中添加值,然后按回车键添加数据库.我并不担心服务器端代码.我希望能够仅渲染下拉列表.
提前致谢.
假设我将这种格式存储在我的postgre数据库表中.现在我必须将这个日期与其中一个texbox值包含不同格式的日期进行比较.
Database Date Format :: YYYY-MM-DD For example :: 2010-11-26
Text-Field Date Format :: Day, Month Date, Year :: Fri, Nov 26, 10
Run Code Online (Sandbox Code Playgroud)
现在我试图比较这个值但没有Plz建议的回应.
Select * from table_name where user_id=('11')
and to_char(effective_date, $$$$$$$$)=trim('Fri, Nov 26, 10');
Run Code Online (Sandbox Code Playgroud)
现在Plz建议我应该用哪种格式代替$$$$$$$$ ???
谢谢 !!!
我正在研究Rails 1.2.3版本.现在我想将Rails版本以及ruy版本从1.8.6升级到1.9.7.
使用这样的旧版本是一个很大的痛苦,但它处于运行状态.现在我想要Rails的高级功能但不支持这个旧版本.
请建议我升级版本和ruby版本的方法.
谢谢....
在这里,我使用rubyzip和nokogiri来修改.docx文件.
RubyZip -> Unzip .docx file
Nokogiri -> Parse and change in content of the body of word/document.xml
Run Code Online (Sandbox Code Playgroud)
正如我在下面编写示例代码但代码修改了文件但其他文件受到干扰.换句话说,更新的文件未打开,显示文字处理器崩溃的错误.我该如何解决这个问题?
require 'zip/zipfilesystem'
require 'nokogiri'
zip = Zip::ZipFile.open("SecurityForms.docx")
doc = zip.find_entry("word/document.xml")
xml = Nokogiri::XML.parse(doc.get_input_stream)
wt = xml.root.xpath("//w:t", {"w" => "http://schemas.openxmlformats.org/wordprocessingml/2006/main"}).first
wt.content = "FinalStatement"
zip.get_output_stream("word/document.xml") {|f| f << xml.to_s}
zip.close
Run Code Online (Sandbox Code Playgroud) 是否可以看到Heroku服务器的最后一个日志.我曾经heroku logs
看过最后一个过程,但它显示了有限的日志.但是我希望在heroku看到更多的进程.那么我应该遵循什么命令或什么过程来查看Heroku上的日志.
提前致谢.