小编zac*_*ach的帖子

SQL Server Studio管理中重复行的快捷方式?

在Netbeans和Eclipse中,您可以按CTRL + Shift + Down(我认为这是netbeans),它将复制一行代码.这可能在SQL Server Management Studio中吗?这与SQL Server 2008一起运行

ssms sql-server-2008

13
推荐指数
2
解决办法
8379
查看次数

数组常量只能用于初始值设定项错误

考虑:

public proj 3 {

    static string [][]Item;

    public static void main(String [] args){

        Item[][] = {
             {"BH," , "Backhoe,"            , "200.00"},
             {"ER," , "Electric Rake,"      ,  "10.00"},
             {"EL," , "Electric Lawnmower," ,  "15.00"},
             {"TR," , "Trencher"            ,  "35.00"},
             {"MU," , "Mulcher,"            ,  "20.00"},
             {"TS," , "Tree Sprayer,"       ,  "22.00"},
             {"CP," , "Cider Press,"        ,  "30.00"},
             {"PR," , "Pruner,"             ,  "12.00"},
             {"GE," , "Gas Edger,"          ,  "20.00"},
             {"RO," , "Roller,"             ,   "8.00"},
Run Code Online (Sandbox Code Playgroud)

我怎么能这样做,所以我可以用不同的方法调用数组?

java arrays multidimensional-array

11
推荐指数
2
解决办法
2万
查看次数

如何将ADO Recordset插入MS Access Table

问题

我想将当前记录集行插入MS Access表.我目前收到此错误

Syntax error (missing operator) in query expression 'rs[columnname]'
Run Code Online (Sandbox Code Playgroud)

这是我当前的代码,我试图抓住所有列并将它们插入到新表中.

DoCmd.RunSQL "INSERT INTO tblSummary_Appl_Usage_score VALUES (rs[Configuration], rs[User Input / Output])"
Run Code Online (Sandbox Code Playgroud)

我不太清楚我错过了什么.

ms-access vba insert ms-access-2010

8
推荐指数
2
解决办法
3万
查看次数

如何在informix数据库中搜索列

我希望能够在Informix DB中搜索列.在主表中有一个cust_nbr列,然后在未知数量的表中引用.

在Informix中,有没有办法查询数据库并获取所有使用cust_nbr的表?

sql informix

4
推荐指数
1
解决办法
8866
查看次数

将NSArray写入文件

我试图保存/写一个数组到文件目录,我完全卡住了.我已经在线查看了多个来源的代码.我从和NSArray切换到NSMutableArray,但是没有用.据我所知,文件没有被写入,因为测试将返回null.提前致谢

NSArray *results = [parser objectWithData:data1];

NSMutableArray *array2 = [[NSMutableArray alloc] initWithArray:results];
// Create a dictionary from the JSON string  

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"EmployeeData.plist"];

//NSLog(@"the path is %@, the array is %@", path, array2);

/////write to file/////
[array2 writeToFile:path atomically:YES];

NSMutableArray *test = [[NSMutableArray alloc ]initWithContentsOfFile:path];

NSLog(@"the test is %@", test);
Run Code Online (Sandbox Code Playgroud)

**更新**

我添加了这些代码行

BOOL write = [results writeToFile:path atomically:YES];

NSLog(@"did it right? %@", write);
Run Code Online (Sandbox Code Playgroud)

并且写为null,这是什么意思?

这是我的Array中的众多对象之一

{
     0 …
Run Code Online (Sandbox Code Playgroud)

cocoa-touch objective-c ios

3
推荐指数
1
解决办法
7737
查看次数

保存到没有SD卡的设备

我的朋友和我正在尝试创建一个将文件保存到设备的应用程序.我们使用此代码写入外部SD卡,它在他的Droid X和三星Galaxy Tab上运行良好.

获取SD卡的路径:

private static final File ROOT = Environment.getExternalStorageDirectory();
Run Code Online (Sandbox Code Playgroud)

创建文件夹路径和文件:

FileWriter fw = new FileWriter(ROOT + "/test/" + "time_frames.txt");
Run Code Online (Sandbox Code Playgroud)

我们正在使用文档工厂来创建文档

所以你可以看到我们创建路径然后尝试保存到刚刚创建的路径

File file = new File(ROOT + "/test/" + "time_frames.txt");
Run Code Online (Sandbox Code Playgroud)

当我在我的Nexus S(没有SD卡)上运行它时,使用完全相同的代码时遇到问题.

private static final File ROOTtest = Environment.getExternalStorageDirectory();
Run Code Online (Sandbox Code Playgroud)

这返回/数据

private static final File ROOT = Environment.getRootDirectory();
Run Code Online (Sandbox Code Playgroud)

这会返回/ mnt/sdcard

private static final File intData = Environment.getDataDirectory();
Run Code Online (Sandbox Code Playgroud)

这返回/系统

我的问题是哪一个适用于具有SD卡且没有SD卡的设备?我已经尝试了很多,但尝试所有这些东西真的让我很困惑.提前致谢

android android-sdcard

1
推荐指数
1
解决办法
3158
查看次数

4D阵列问题

有人可以解释为什么我收到此错误

Type mismatch: cannot convert from String to String[][][]
Run Code Online (Sandbox Code Playgroud)

在这段代码?

String [][][][] names = {"zach","zach","zach","zach"};
Run Code Online (Sandbox Code Playgroud)

java arrays string multidimensional-array

1
推荐指数
1
解决办法
1425
查看次数

从NSMutableDictionary获取对象并在UITableView中显示它

建立

我有NSMutableDictionaries的NSMutableDictionary.我创建了一个搜索术语的字典,现在我想显示它们.我使用一种方法(下面)将包含搜索词的项复制到另一个词典中.我知道它正在复制,因为我可以打印字典并查看结果.此外,还会显示正确的行数,但不会显示其中的数据.我已经包含了复制字典的方法,以及字典在原始数组中看起来喜欢的内容以及它在新数组中的样子.

问题

我对从NSDictionaires中提取物品的理解是不正确的.我已经阅读了多个地方,我知道我想使用objectforkey.但我无法弄清楚如何将字典从主词典中删除并显示出来.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";


UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}    
if (searching) {


 //ATTEMPT ONE
 //        NSDictionary *searchEmp = [copyListOfItems objectForKey:[copyListOfItems allkeys]];    
//        cell.textLabel.text = [[searchEmp objectForKey:kFULLNAME_TAG] objectAtIndex:indexPath.row];               

//ATTEMPT TWO     
    NSString *name = [[copyListOfItems allKeys] objectAtIndex: indexPath.row];
    NSString *value = [copyListOfItems objectForKey:path];

    cell.textLabel.text = [copyListOfItems objectForKey:value];




}else{

     NSDictionary *employee = [[self.orderedSections valueForKey:[[[self.orderedSections allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];

cell.textLabel.text …
Run Code Online (Sandbox Code Playgroud)

uitableview nsmutabledictionary ios4 ios

0
推荐指数
1
解决办法
1万
查看次数