[Mono-devel-list] DataView oddness

nick Ricketts nightshade427 at gmail.com
Tue Apr 26 13:07:49 EDT 2005


Here is the code I am trying to run. It seems to be deleting the
underlying datatable rows when it should only be deleting the
DataRowViews for them. It works perfect under windows. Any Ideas. (the
dbsqlstoredproc class just gets a dataset from database using stored
procs).

if(dsProcedures.Tables[0].Rows.Count > 0){
       dsProcedures.Tables[0].DefaultView.Sort = "dpr_priority";
       dsProcedures.Tables[0].DefaultView.RowStateFilter =
DataViewRowState.OriginalRows;
       foreach(DataRowView drView in dsProcedures.Tables[0].DefaultView){
               DBSqlStoredProc procPhotos = new
DBSqlStoredProc("getDoctorProcedurePhotoCollection", Global.PSConn());
               procPhotos.Parameters.Add("client",Page.Request.QueryString["doctor"]);
               procPhotos.Parameters.Add("procedure",drView["pro_name"].ToString());
               DataSet dsPhotos = procPhotos.Execute();
               if(dsPhotos.Tables[0].DefaultView.Count > 0){
                       indexMostImportant = drView["pro_name"].ToString();
                       dlPhotos.DataSource = dsPhotos.Tables[0].DefaultView;
               }
               else{
                       drView.Row.Delete();
               }
       }
       dsProcedures.Tables[0].AcceptChanges();
       ddlProcedures.DataTextField = "pro_name";
       ddlProcedures.DataSource = dsProcedures.Tables[0];
       ddlProcedures.DataBind();
       if(indexMostImportant == String.Empty){
               pnlMiniPhoto.Visible = false;
       }
       else{
               dlPhotos.DataBind();
               ddlProcedures.SelectedValue = indexMostImportant;
       }
}

On 4/24/05, Atsushi Eno <atsushi at ximian.com> wrote:
>
> nick Ricketts wrote:
> > I have noticed some differences in the way .NET and mono handle
> > DataViews especially when it comes to DataView.RowFilter or
> > DataView.Sort they act totally different and give different results is
> > anyone else experiencing this??
>
> Yes. There used to be.
>
> I have no idea which version of mono you are talking about here,
> and we won't fix anything without concrete examples.
>
> Regards,
> Atsushi Eno
>
>



More information about the Mono-devel-list mailing list