日期:2014-05-17 浏览次数:20534 次
SqlParameter[] paramArray = new SqlParameter[1]; paramArray[0] = new SqlParameter("@baseName", baseName); strCommandText = "use topfiveleaguedb delete from @baseName"; SqlHelper.ExecuteNonQuery(CommandType.Text, strCommandText, paramArray);
Quote: 引用: baseName是空?不是,都是正常的数值,但是只要传库名就不行
baseName是空?
Quote: 引用: strCommandText = "use topfiveleaguedb delete from @baseName"; SqlParameter[] paramArray = new SqlParameter[1]; paramArray[0] = new SqlParameter("@baseName", baseName); SqlHelper.ExecuteNonQuery(CommandType.Text, strCommandText, paramArray); 感觉和我写的没什么区别啊
strCommandText = "use topfiveleaguedb delete from @baseName"; SqlParameter[] paramArray = new SqlParameter[1]; paramArray[0] = new SqlParameter("@baseName", baseName); SqlHelper.ExecuteNonQuery(CommandType.Text, strCommandText, paramArray);
strCommandText = string.Format("use topfiveleaguedb delete from {0}",baseName); SqlHelper.ExecuteNonQuery(CommandType.Text, strCommandText,new SqlParameter[]{ });