现在的位置: 首页 > 综合 > 正文

@好处多多

2012年11月20日 ⁄ 综合 ⁄ 共 513字 ⁄ 字号 评论关闭

@好处多多
1.文件路径
 strFileFrom="\\172.16.20.12\e$\CCL_Development\ProExcelTest\Engg_Index_DFS\Report"
这种形式的在C#中会报错.
解决方法:
 strFileFrom="\\\\172.16.20.12\\\e$\\\CCL_Development\\\ProExcelTest\\\Engg_Index_DFS\\\Report"
 strFileFrom=@"\\172.16.20.12\e$\CCL_Development\ProExcelTest\Engg_Index_DFS\Report"

2.程序中写SQL语句
一般方法:
            string strSQL = "SELECT id,title,note,stime FROM tabnews ";
            strSQL += "WHERE title like '%abc%' ";
修改后:
            string strSQL = @"SELECT id,title,note,stime FROM tabnews
            WHERE title like '%abc%' ";

抱歉!评论已关闭.