public string GetSystemDate()
{

try
{ if(this.sqlConnection1.State == ConnectionState.Closed)
{
this.sqlConnection1.Open();
}
}
catch
{
MessageBox.Show("数据库连接失败!");
return("");
}
SqlCommand cmm = new SqlCommand();
SqlDataAdapter sda = new SqlDataAdapter();
cmm.Connection = sqlConnection1;
sda.SelectCommand = cmm;
string sDay;
System.Data.SqlClient.SqlDataReader read;
try
{
sda.SelectCommand.CommandText="select getdate() from systypes";
read=sda.SelectCommand.ExecuteReader();  
read.Read();
sDay=read.GetDateTime(0).ToString();
read.Close();
return(sDay);
}
catch(System.Exception en)
{
MessageBox.Show(""+en.Message);
return("");
}
finally
{
cmm.Dispose();
sda.Dispose();
sqlConnection1.Close();
}
}