【简答题】
向数据库添加记录,其中InsertSQL是一条插入操作的Sql语句,objConnection 是连接对象,以下代码运行时会出现错误的是() A. A、 SqlDataApdapater objAdaptor = new SqlDataApdater();objAdaptor.DeleteCommand = objConnection.CreateCommand(); objAdaptor.DeleteCommand.CommandText = strInsertSQL; B. SqlCommand objCommand = new SqlCommand(strInsertSQL,objConnection); C. SqlCommand objCommand = objConection.CreateCommand(); objCommand.CommandText = strInsertSQL; D. D、 SqlCommand objCommand = objConection.CreateCommand(); objCommand.CommandText = strInsertSQL; objCommand.CommandType = CommandType.StoredProcedure;
参考答案:
参考解析:
举一反三