在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1 string connectionString = string.Format("server=(local);uid=sa;pwd=1234567890;database=msp430"); 2 using (SqlConnection con = new SqlConnection(connectionString)) 3 { 4 con.Open(); 5 SqlCommand cmd = new SqlCommand("UpdateData", con); 8 cmd.CommandType = CommandType.StoredProcedure; 9 cmd.Parameters.Add("@shin", SqlDbType.Float).Value = Shine; 带有5个输入参数的存储过程。。还有执行单个command指令时要采用: sql = "insert into site1AutoData(站点,灰尘度,光照度,气体浓度,空气温度,空气湿度,记录时间) values(01," + num1 + "," + _num2 + "," + _1num3 + "," + _num4 + "," + _num5 + ",'" + time + "')"; 用”“括起来,若是字符串的还需要加'' |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论