请试一下下面的代码,如果还不行,请看一下这里:
http://www.cnblogs.com/deerchao/archive/2007/11/06/950675.html
namespace Haoting.UI
{
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
if(!DesignMode)
{
ProjectManager pm = new ProjectManager();
label1.Text = pm.GetById("{8676E22F-1B62-4760-BF33-B8D44D4BB634}").Tables[0].Rows[0][0].ToString();
}
}
}
}