摘要: 使用C#将指定文件夹以及子文件夹中的图片文件插入到MSSql数据库:using System.Data.SqlClient;using System;using System.IO;public class Photo{ public static void Main(string[]args) { byte[]byts=null; FileStream fs=null; string []files=Directory.GetFiles("./images","*.*",SearchOption.AllDirectories); ... 阅读全文
posted @ 2012-06-22 21:29 痞子笑 阅读(1371) 评论(0) 推荐(0) 编辑
摘要: MySQL使用基于Parameter方式代码,总是提示:“Column '列名' cannot be null”MySQL使用基于Parameter方式代码,总是提示:“Column '列名' cannot be null”解决方法1:直接在连接字符串里面加一个 oldsyntax=true 即可。例如:server=127.0.0.1;user id=root;password=;database=itemdb;oldsyntax=true解决方法2:将语句中的 @ 替换为 ?例如:StringBuilder strSql=new StringBuilder( 阅读全文
posted @ 2012-06-22 21:21 痞子笑 阅读(6013) 评论(0) 推荐(0) 编辑