你的插入代码我没有看出错误来,你在SqlCommand cm=new SqlCommand(strSQL,cn);
这句话后面加上这个看看cm.CommandType=CommandType.CommandText;