hie all, 我只想在表中爲空時插入數據到表中,所以爲此我需要檢查條件以檢查數據是否已經存在於表中,如果存在的話,我想在插入新值之前清空表格。 我知道如何插入和刪除數據只有prob是檢查條件。所以請在這裏幫助我。如何檢查表是否爲空
要插入
Dim comUserSelect As OleDbCommand
myDateTime(i) = DateTime.Parse(arr_dateTime(i))
' Console.WriteLine(r("P1"))
Dim strSELEsCTa As Integer = r("P1")
If ins < 10 Then
ins = ins + 1
Dim strSELECTa As String = "insert into tblvalues (DataTime ,P1) values ('" & DateTime.Parse(arr_dateTime(i)) & "','" & strSELEsCTa & "')"
Dim dadte_s As New OleDbDataAdapter(strSELECTa, conn)
comUserSelect = New OleDbCommand(strSELECTa, conn)
comUserSelect.ExecuteNonQuery()
End If
*刪除*
Dim strDelete As String = "delete * from tblvalues "
現在我不知道如何檢查車況
插入查詢將是容易受到SQL注入 –