zd.y = 80;
MessageBox.Show("变换成功");
}
else if (iiii == 5)
{
qd.x = 100;
qd.y = 40;
zd.x = 260;
zd.y = 60;
MessageBox.Show("变换成功");
}
else
iiii = 1;
button1.Enabled = true;
button7.Enabled=false ;
图 5-3变换始终节点界面
5.4 保存实验结果模块功能
保存实验结果模块主要是计算实验的结果,连接数据库并将算出的结果存入数据库。
代码如下:
SqlConnection conn = new SqlConnection("Data Source=KONG\\SQLEXPRESS;Trusted_Connection=SSPI;Initial Catalog=qqq");
conn.Open();
SqlCommand com = new SqlCommand("delete ta where 实验次数 is not NULL",conn);
com.ExecuteNonQuery();
conn.Close();*/
MessageBox.Show("连接成功");
SqlDataAdapter myadapter = new SqlDataAdapter("select *from ta", conn);
SqlCommandBuilder sqlBulider = new SqlCommandBuilder(myadapter);
DataSet ds = new DataSet();
myadapter.Fill(ds, "ta");
SqlCommandBuilder sqlBulider = new SqlCommandBuilder(myadapter);
DataRow row;
row = ds.Tables["ta"].NewRow();
ds.Tables["ta"].Rows.Add(row);
ds.Tables["ta"].Rows[ggg]["实验次数"] =ggg+1;
ds.Tables["ta"].Rows[ggg]["gdr跳数"] = ts[0]; 无线传感器网络中数据传输最优路径选择(11):http://www.751com.cn/tongxin/lunwen_2234.html