日期:2014-05-17 浏览次数:20858 次
private DataTable MessageCount = new DataTable();
private SqlDataAdapter MyDs = new SqlDataAdapter();
private void timer1_Tick(object sender, EventArgs e)
{
string ServerIP = txtServerIP.Text;
string UserName = txtUserName.Text;
string PassWord = txtPassWord.Text;
string DataName = txtDataName.Text;
string strMyConn = "Server=" + ServerIP + ";user id=" + UserName + ";password=" + PassWord + ";initial catalog=" + DataName + ";";
SqlConnection MySQLConn = new SqlConnection(strMyConn);
SqlCommand Ds = new SqlCommand("EXEC CS_CountMessag", MySQLConn);
MyDs.SelectCommand = Ds;
MyDs.Fill(MessageCount);
dataGridView1.DataSource = MessageCount;
}
private DataTable MessageCount = new DataTable();