我的mySQl数据库中有此表:
ID First_Name Second_Name Age RFID_Tag Amount_Serve -------------------------------------------------------------- 1 John Smith 28 hdgdYun8JH Small 2 George Mark 35 kdjfHluhHB Big
并具有用于mysql查询的代码
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim str As String = "Server=localhost;Port=3306;Database=namesdb;Uid=root;Pwd=1234"
Using con As New MySqlConnection(str)
Dim query As String = "select * from namedata where rfid_tag=@rfid"
Dim cm As New MySqlCommand(query, con)
con.Open()
cm.Parameters.Add("@rfid", MySqlDbType.VarChar).Value = TextBox3.Text
Dim rd As MySqlDataReader = cm.ExecuteReader()
' Check if any rows exist
If rd.HasRows = True Then
MessageBox.Show("trun on sm")
Else
MessageBox.Show("Not your time")
End If
End Using
End Sub
我想要的是当textbox3.text中的rfid标记等于表中的rfid标记时,如果那个rfid量用于小型,则运行小号python脚本,对于大型则运行大号的脚本,我想使用IF函数形式 我认为是要重播:
If rd.HasRows = True Then
如果Amount_server = Small那么就变成这样
我希望我能为这个案件弄清楚任何帮助。
答案 0 :(得分:0)
首先感谢@TetsuyaYamamoto给我提示!
解决方案是这样的:
function angle(cx, cy, ex, ey) {
var dy = ey - cy;
var dx = ex - cx;
var theta = Math.atan2(dy, dx); // range (-PI, PI]
theta *= 180 / Math.PI; // rads to degs, range (-180, 180]
if (theta < 0) theta = 360 + theta; // range [0, 360)
return theta;
}
感谢所有人