日期:2014-05-18 浏览次数:20971 次
int boxId=你的boxId; string connString="连接字符串"; string sqlStr = "insert into SF_BoxInfo (BoxID) values (@BoxID)"; SqlConnection conn = new SqlConnection(connString); SqlCommand cmd = new SqlCommand(sql, conn); SqlParameter[] p ={ new SqlParameter("@BoxID",SqlDbType.Int) }; P[0].Value=boxId; cmd.Parameters.AddRange(p); conn.Open(); cmd.ExecuteNonQuery(); conn.Close();