关于如何取Dev Express中一些控件中的数据与Oracle的一些操作

radioGroup如何取他的description:radioGroup1.Properties.Items[0].Description;

radioGroup如何取他被选中的description:radioGroup1.Properties.Items[radioGroup1.SelectedIndex].Description;

gridControl1.DataSource = infoList;
                gridControl1.RefreshDataSource();
                gridView1.OptionsView.ColumnAutoWidth = false;
                gridView1.OptionsBehavior.Editable = false;
                gridView1.Columns[0].Caption = "发布人";
                gridView1.Columns[1].Caption = "所在部门";
                gridView1.Columns[2].Caption = "信息类型";
                gridView1.Columns[3].Caption = "阅读范围";
                gridView1.Columns[4].Caption = "标题";
                gridView1.Columns[5].Caption = "发布时间";

private void SetGridControlData()
        {
            vGridControl.Rows.Add(new DevExpress.XtraVerticalGrid.Rows.CategoryRow("附着整体情况"));
            for (int i = 0; i < allView.ListKeyValue.Count; i++)
            {
                DevExpress.XtraVerticalGrid.Rows.EditorRow editorRow = new DevExpress.XtraVerticalGrid.Rows.EditorRow();
                DevExpress.XtraEditors.Repository.RepositoryItemTextEdit repositoryItemTextEdit = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
                editorRow.Properties.Caption = allView.ListKeyValue[i].Key;
                editorRow.Properties.Value = allView.ListKeyValue[i].DataValue;
                editorRow.Properties.RowEdit = repositoryItemTextEdit;
                vGridControl.Rows.Add(editorRow);
            }
            vGridControl.BestFit();
            vGridControl.OptionsView.FixRowHeaderPanelWidth = true;
            vGridControl.OptionsView.AutoScaleBands = true;
            vGridControl.OptionsBehavior.Editable = false;
        }

        private void DrawAllResult()
        {
            chartAllResult.Series.Clear();
            DevExpress.XtraCharts.Series drawSeries = new DevExpress.XtraCharts.Series("allview", DevExpress.XtraCharts.ViewType.Pie3D);
            if (allView.ListKeyValue.Count > 0)
            {
                drawSeries.Points.Add(new DevExpress.XtraCharts.SeriesPoint(allView.ListKeyValue[0].Key, allView.ListKeyValue[0].DataValue));
            }
            for (int i = 2; i < allView.ListKeyValue.Count; i++)
            {
                drawSeries.Points.Add(new DevExpress.XtraCharts.SeriesPoint(allView.ListKeyValue[i].Key, allView.ListKeyValue[i].DataValue));
            }
            ((DevExpress.XtraCharts.PiePointOptions)drawSeries.PointOptions).PercentOptions.ValueAsPercent = true;
            ((DevExpress.XtraCharts.PiePointOptions)drawSeries.PointOptions).PercentOptions.PercentageAccuracy = 4;
            drawSeries.View = new DevExpress.XtraCharts.Pie3DSeriesView();
            drawSeries.LegendPointOptions.PointView = DevExpress.XtraCharts.PointView.ArgumentAndValues;
            drawSeries.PointOptions.PointView = DevExpress.XtraCharts.PointView.Values;
            drawSeries.PointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.Percent;
            drawSeries.LegendPointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.Percent;
            chartAllResult.Series.Add(drawSeries);
        }

 

private void gControlDetail_Click(object sender, EventArgs e)
        {
            try
            {
                DevExpress.XtraGrid.Views.Grid.GridView gViewErrorList = (DevExpress.XtraGrid.Views.Grid.GridView)gControl.ViewCollection[0];
                if (gViewErrorList.Columns.Count == 3)
                {
                    gViewErrorList.ViewCaption = "错误详细";
                    gViewErrorList.OptionsView.ShowViewCaption = true;
                    gViewErrorList.OptionsDetail.ShowDetailTabs = false;
                    gViewErrorList.OptionsView.ColumnAutoWidth = true;
                    gViewErrorList.OptionsBehavior.Editable = false;
                    gViewErrorList.Columns[0].Caption = "错误原因";
                    gViewErrorList.Columns[1].Caption = "错误次数";
                    gViewErrorList.Columns[2].Caption = "错误比例";
                    gViewErrorList.Columns[2].OptionsColumn.AllowEdit = false;
                    //giewErrorList.Columns[2].OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
                    gViewErrorList.Columns[2].DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
                    gViewErrorList.Columns[2].DisplayFormat.FormatString = "P";
                    //gViewDetail.BestFitColumns();
                    gControl.ViewCollection.Clear();
                    //DrawOneSite(rowHandle);
                }
            }
            catch
            {
            }
            if (gViewDetail.GetSelectedRows().Length > 0)
            {
                int rowHandle = gViewDetail.GetSelectedRows()[0];
                if (rowHandle >= 0)
                {
                    DrawOneSite(rowHandle);
                }
            }
        }

 

 

gridControl中如何取得选中的gridview中的某个数据:gridView1.GetRowCellValue(gridView1.GetFocusedDataSourceRowIndex(), name);其中name是指要取得那一列的名称!

Oracle的insert,delete,update语句的使用:OracleConnection conn = new OracleConnection("Data Source=192.168.1.190:1521/orclunic;User ID=ruiyuan;Password=ruiyuan;Unicode=True");
            string sqlStr = "update tablename set columnsname1= 'xxx' where columnsname2='xxxxx';

            string sqlStr = "delete from tablename where columnsname1='xxx' ;

            string sqlStr = "insert into information values('','','','',''....);
            OracleCommand cmd = new OracleCommand(sqlStr, conn);
            cmd.Connection.Open();
            cmd.ExecuteNonQuery();
            cmd.Connection.Close();

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值