我最近在我的Windows 7 Ultimate x64家用机器上安装了SQL Server 2008 Express.我还有IIS 7.5和PHP 5.3,我试图通过ADODB连接到SQL ,但不断收到此错误:
[Microsoft][ODBC Driver Manager] The specified DSN contains an
architecture mismatch between the Driver and Application
Run Code Online (Sandbox Code Playgroud)
在互联网上进行少量挖掘之后,我认为这是因为SQL Server ODBC驱动程序适用于32位操作系统,而我的64位操作系统.首先,我是否正确?这是我遇到麻烦的原因吗?其次,如果是这样,我该如何解决这个问题呢?是否有任何更新的ODBC驱动程序可以与64位操作系统一起使用?我看了但是找不到任何......
我正在使用log4net和AdoNetAppender.它将所有日志信息记录到表中.该表实际上有2个整数列(可以为null).
这是我的log4net配置的相关部分:
<commandText value="INSERT INTO ActivityLog ([Date],[Thread],[Level],[Logger],[Message],[DealID])
VALUES (@log_date,@thread,@log_level,@logger,@message,@DealID)" />
//other parameters hten DealID
<parameter>
<parameterName value="@DealID" />
<dbType value="Int32" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{DealID}" />
</layout>
</parameter>
Run Code Online (Sandbox Code Playgroud)
我发现的是,如果我没有明确设置使用类似的东西log4net.ThreadContext.Properties["DealID"] = DealID;会引发异常:
System.FormatException occurred
Message="Failed to convert parameter value from a String to a Int32."
Source="System.Data"
StackTrace:
at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType)
InnerException: System.FormatException
Message="Input string was not in a correct format."
Source="mscorlib"
StackTrace:
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles …Run Code Online (Sandbox Code Playgroud) 我是Cocoa的新手,并且正在通过Hillegass的书.我在第20章的挑战2中遇到了麻烦.
挑战是添加复选框,如果绘制的字母是斜体,粗体或两者,则切换.
-(IBAction)toggleItalic:(id)sender
{
int state = [italicBox state];
NSLog(@"state %d", state);
if (state = 1) {
italic = YES;
NSLog(@"italic is yes");
}
else {
italic = NO;
NSLog(@"italic is no");
}
}
Run Code Online (Sandbox Code Playgroud)
现在,当检查框这个代码片段将返回肯定的,而当没有选中该复选框.我究竟做错了什么?
谢谢,
贾斯汀.
我正在寻找一种方法来处理以下场景.我有一个数据库表,我只需要为表中包含的每个"组ID"返回一条记录,而且每个组中选择的记录应该是家庭中最老的人.
ID Group ID Name Age
1 134 John Bowers 37
2 134 Kerri Bowers 33
3 135 John Bowers 44
4 135 Shannon Bowers 42
Run Code Online (Sandbox Code Playgroud)
因此,在上面提供的示例数据中,我需要返回ID 1和3,因为它们是每个组ID中最老的人.
正在针对SQL Server 2005数据库查询此问题.
我正在运行 PHP 版本 5.2.11
当我运行下面的函数时:
function get_dirs($path = '.') {
$dirs = array();
foreach (new DirectoryIterator($path) as $file) { // This is line 462.
if ($file->isDir() && !$file->isDot()) {
$dirs[] = $file->getFilename();
}
}
return $dirs;
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
Fatal error: Uncaught exception 'RuntimeException' with message 'DirectoryIterator::__construct(/home/test/test.com/wp-content/themes/mytheme/images) [<a href='directoryiterator.--construct'>directoryiterator.--construct</a>]: failed to open dir: No such file or directory' in /home/test/test.com/testing123/wp-content/themes/mytheme/functions.php:462 Stack trace: #0 /home/test/test.com/testing123/wp-content/themes/mytheme/functions.php(462): DirectoryIterator->__construct('/home/test/wie...') #1 /home/test/test.com/testing123/wp-content/themes/mytheme/functions.php(31): get_dirs('/home/test/wie...') #2 /home/test/test.com/testing123/wp-settings.php(717): include('/home/test/wie...') #3 /home/test/test.com/testing123/wp-config.php(76): require_once('/home/test/wie...') #4 /home/test/test.com/testing123/wp-load.php(30): require_once('/home/test/wie...') #5 /home/test/test.com/testing123 in /home/test/test.com/testing123/wp-content/themes/mytheme/functions.php …Run Code Online (Sandbox Code Playgroud) 我有一个字符串中的路径,
"C:\ TEMP\mybackup.zip"
我想在该脚本中插入一个时间戳,例如,
"C:\ temp\mybackup 2009-12-23.zip"
在PowerShell中有一种简单的方法吗?
我在将RubyGems从1.1.1版更新到最新版时遇到了困难.我尝试过以下方法:
宝石更新
结果:
更新已安装的gems
批量更新Gem源索引:http://gems.rubyforge.org/
无需更新
和
gem install rubygems-update
结果:
批量更新Gem源索引:http://gems.rubyforge.org/
批量更新Gem源索引:http
://gems.rubyforge.org/错误:安装rubygems-update时出错:
rubygems-update需要构建器(> = 0)
和
gem install rubygems-update update_rubygems
结果:
批量更新Gem源索引:http://gems.rubyforge.org/
批量更新Gem源索引:http
://gems.rubyforge.org/错误:安装rubygems-update时出错:
rubygems-update需要构建器(> = 0)
错误:无法在本地或存储库中找到update_rubygems
然后我检查,如建议的theIV上类似的问题,我是否有http://gems.rubyforge.org/在我的远程数据源.这是宝石环境:
RubyGems环境:
- RUBYGEMS版本:1.1.1
- RUBY版本:1.8.6(2008-08-11 patchlevel 287)[universal-darwin9.0]
- 安装目录:/ Library/Ruby/Gems /1.8
- RUBY EXECUTABLE:/系统/库/框架/ Ruby.framework/Versions/1.8/usr/bin/ruby
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-9
- GEM路径:
-
/ Library/ Ruby/Gems/1.8 - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- …
如何在Mac OS X下运行Linux二进制文件?
谷歌搜索我发现了几个模拟器,但没有在Mac上运行Linux二进制文件.有很多关于在Linux上运行Mac OS X的帖子和那种东西 - 但这与我想做的相反.
更新:
感谢所有的答案!我完全了解MacPorts和Fink或任何其他事情; 不,我不想要任何这些实用程序,我不想要任何包管理器,我更喜欢自己编译.我也有Parallels,可以设置虚拟机和所有爵士乐......
我唯一想做的就是找到一种方法来运行我没有源代码的二进制文件,并且已经为Linux编译了,但我不想在Linux下运行它,但在Mac OS X下运行它.所以我的关于模拟器的问题.
看到所有UNIX人员都有memcache(PHP,Python等),.NET库是否经过压力测试并且效率相同?(或者更多?)
有什么不同?
我希望能够看到一个元素是否在HashMap中,我发现如果我执行h [element],它将返回默认元素(如果找不到),而不是null.我如何使用迭代器查找方法来查看元素是否存在?
谢谢