如何将SQL Server 中保存的数据带入dateTimePicker 值? 我的代码不起作用!
public partial class form1 : Form
{
public form1()
{
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\jack\Documents\events.mdf;Integrated Security=True;Connect Timeout=30");
con.Open();
SqlCommand cmd = new SqlCommand("select date1 from Tbbus where date1@date1", con);
cmd.Parameters.AddWithValue("date", dateTimePicker1.Value);
SqlDataReader reader;
InitializeComponent();
}
}
我试过其他方法还是不行