dmx ad hoc.cs

来自「< SQL Server2005程序设计>」· CS 代码 · 共 29 行

CS
29
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.AnalysisServices.AdomdClient;

namespace Chapter20
{
    public partial class frmDMXAdHoc : Form
    {
        public frmDMXAdHoc()
        {
            InitializeComponent();
        }

        private void btnExecute_Click(object sender, EventArgs e)
        {
            AdomdConnection conn = new AdomdConnection("Data Source=.;Initial Catalog=CustomerProfitMining");
            AdomdCommand cmd = new AdomdCommand(txtQuery.Text, conn);
            AdomdDataAdapter da = new AdomdDataAdapter(cmd);
            DataTable dt = new DataTable();
            da.Fill(dt);
            dgvResults.DataSource = dt;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?