string connectionString = ConfigurationManager.ConnectionStrings["payroll_conn"].ConnectionString;
using (SqlConnection sqlconn = new SqlConnection(connectionString))
{
sqlconn.Open();
using (SqlCommand com = new SqlCommand("SELECT * FROM employee WHERE fname=@fname and designation=@designation", sqlconn))
{
com.Parameters.AddWithValue("@fname", en1.Text);
com.Parameters.AddWithValue("@designation", e1.Text);
using (SqlDataAdapter sda = new SqlDataAdapter(com))
{
ds1 = new DataSet();
sda.Fill(ds1);
}
try
{
label39.Text = ds1.Tables[0].Rows[i]["id"].ToString();
dateTimePicker1.Text = ds1.Tables[0].Rows[i]["enddate"].ToString();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
从数据库中选择后,如何向 dateTimePicker1 添加一天 我遗漏了一些东西,但我不记得了,如果我的问题不好,我该怎么办?
精慕HU
相关分类