using System;
using System.Windows.Forms;
//--------------------------------------
using System.Data;
using System.Data.SqlClient;

namespace _17_11
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string strConn = "Server=.;" + "DataBase=MyCompany;" +
                             "Integrated Security=True";
            
            SqlConnection sCon = new SqlConnection(strConn);
            SqlDataAdapter sda = new SqlDataAdapter("rpt_ID_Diff", sCon);
            sda.SelectCommand.CommandType = CommandType.StoredProcedure;
            sda.SelectCommand.Parameters.AddWithValue("@Sell_ID",
                                         Convert.ToInt32(textBox1.Text));
            
            DataSet ds = new DataSet();
            sCon.Open();
            sda.Fill(ds, "table1");
            sCon.Close();
            
            MessageBox.Show(ds.Tables["table1"].Rows[0][0].ToString());
        }
    }
}