主题:数据库操作
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "data source=(local);initial catalog=Graduate;integrated security=SSPI";
conn.Open();
string time;
time = DateTime.Now.ToLongTimeString();
string str="insert into time values('" + ID + "','" + time + "',)";
SqlCommand cmd = new SqlCommand(str, conn);
SqlDataReader dr = cmd.ExecuteNonQuery();
conn.Close();
dr.Close();
那位高手帮我看下我这代码哪里错了的 ,急吖!!!
conn.ConnectionString = "data source=(local);initial catalog=Graduate;integrated security=SSPI";
conn.Open();
string time;
time = DateTime.Now.ToLongTimeString();
string str="insert into time values('" + ID + "','" + time + "',)";
SqlCommand cmd = new SqlCommand(str, conn);
SqlDataReader dr = cmd.ExecuteNonQuery();
conn.Close();
dr.Close();
那位高手帮我看下我这代码哪里错了的 ,急吖!!!