哪里报错啊?strDSQL,new SqlConnection(DataConfiguration.ConnectionString)
还可以这样写啊,有学一招,呵呵

解决方案 »

  1.   

    你的deleteCommand 是字段还是局部变量?看你有return deleteCommand的返回值,应该是局部变量吧,哪你的deleteCommand 变量在哪定义的?
      

  2.   

    dsCommand = new SqlDataAdapter();
    public bool DeleteCourseRate(cCourseRateData oCourseRateData)
    {
    if (dsCommand == null)
    {
    throw new System.Exception("数据适配器没有初始化");
    }
    dsCommand.DeleteCommand = GetDeleteCommand();
    dsCommand.Update(oCourseRateData,cCourseRateData.TableName); if (oCourseRateData.HasErrors)
    {
    oCourseRateData.Tables[cCourseRateData.TableName].GetErrors()[0].ClearErrors();
    return false;
    }
    else
    {
    oCourseRateData.AcceptChanges();
    return true;
    }
    }谢谢