日期:2014-05-17 浏览次数:20871 次
private void Form1_Load(object sender, EventArgs e)
{
try
{
string connStr = "server=123.234.29.22,11111;database=TZYDB;uid=sa;pwd=wangtao555..!!;max pool size=32767";
SqlConnection Co = new SqlConnection(connStr);
Co.Open();
string str = "select 售点名称,sum(预订量*单价*0.06) as 客户返利金额,sum(预订量*单价*0.08) as 公司返利金额 from cx group by 售点名称";
SqlDataAdapter myada = new SqlDataAdapter(str,Co);
DataSet myds = new DataSet();
myada.Fill(myds);
dataGridView1.DataSource = myds;
Co.Close();
}
catch (Exception)
{
throw;
}
}