Click here to Skip to main content
15,911,762 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Make Form Always On Top, even in fullscreen games. Pin
ph-th1-Dec-10 20:22
ph-th1-Dec-10 20:22 
GeneralRe: Make Form Always On Top, even in fullscreen games. Pin
Yance Lawang1-Dec-10 23:43
Yance Lawang1-Dec-10 23:43 
GeneralRe: Make Form Always On Top, even in fullscreen games. Pin
Yance Lawang2-Dec-10 3:30
Yance Lawang2-Dec-10 3:30 
Questionhow to detect available com ports Pin
dusk8529-Nov-10 18:53
dusk8529-Nov-10 18:53 
AnswerRe: how to detect available com ports PinPopular
Luc Pattyn29-Nov-10 19:02
sitebuilderLuc Pattyn29-Nov-10 19:02 
GeneralRe: how to detect available com ports Pin
Rajesh Anuhya29-Nov-10 23:50
professionalRajesh Anuhya29-Nov-10 23:50 
GeneralRe: how to detect available com ports Pin
Rick Shaub1-Dec-10 8:24
Rick Shaub1-Dec-10 8:24 
Questionread/recieve data from serial port Pin
dusk8525-Nov-10 19:56
dusk8525-Nov-10 19:56 
hi,
i have written the code as shown below,i want to read data from serial port and let it display on the textbox.I compiled the codes and there's nothing wrong with the codes.However,i am not able to read incoming data.Could you help me take a look at my codes?

VB
Public Class Form1
    Dim dset As New DataSet
    Dim dAdapter As OleDb.OleDbDataAdapter
    Dim ConObject As New OleDb.OleDbConnection
    Dim TotalRows As Integer
    Dim Sel As String
    Private Sub OpenPORT1(ByVal PortNum As Integer)
        If SerialPort1.IsOpen Then
            SerialPort1.Close()
        End If

        

        SerialPort1.PortName = "COM" + Convert.ToString(PortNum)
        SerialPort1.BaudRate = 38400
        SerialPort1.Parity = System.IO.Ports.Parity.None
        SerialPort1.StopBits = System.IO.Ports.StopBits.One

        SerialPort1.RtsEnable = True
        SerialPort1.Open()
    End Sub

    Private Sub ResetBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResetBtn.Click
        Dim cBuilder As New OleDb.OleDbCommandBuilder(dAdapter)
        Dim counter As Integer

        TextBox1.Clear()
        display_box.Clear()
        RS232.Clear()


        TotalRows = dset.Tables("EMSdatabase").Rows.Count
        If TotalRows > 25 Then
            For counter = 25 To TotalRows - 1
                dset.Tables("EMSdatabase").Rows(25).Delete()
                dAdapter.Update(dset, "EMSdatabase")
            Next counter

        End If

    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ConObject.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Users\pohyingling\Desktop\development of an enviroment monitoring sys\EMS\EMS\EMSdatabase.mdb"

        ConObject.Open()

        Sel = "SELECT*FROM ems"
        dAdapter = New OleDb.OleDbDataAdapter(Sel, ConObject)
        dAdapter.Fill(dset, "EMSdatabase")
        ConObject.Close()

        TotalRows = dset.Tables("EMSdatabase").Rows.Count
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick


        If InStr(display_box.Text, "") Then
            'dset.Tables("EMSdatabase").Rows("").Item("Data:") = display_box.Text
            dAdapter.Update(dset, "EMSdatabase")


        End If
    End Sub

    Private Sub StartBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StartBtn.Click
        Timer1.Enabled = True
    End Sub
    
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        If IsNumeric(RS232.Text) = False Then
            RS232.Text = InputBox("Enter waspmote COM port no'")
        Else
            Call OpenPORT1(Convert.ToInt16(RS232.Text))
            display_box.Text = SerialPort1.ReadExisting
        End If

    End Sub

    Private Sub DisplayDatabaseBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DisplayDatabaseBtn.Click
        Dim Counter As Integer
        Dim Data As String

        TextBox1.Clear()

        TotalRows = dset.Tables("EMSdatabase").Rows.Count

        For Counter = 0 To TotalRows - 1

            Data = dset.Tables("EMSdatabase").Rows(Counter).Item("Data:")

            TextBox1.Text = TextBox1.Text + Data + vbNewLine

        Next Counter
    End Sub

    Private Sub deleteBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles deleteBtn.Click
        Dim cBuilder As New OleDb.OleDbCommandBuilder(dAdapter)
    End Sub
End Class

AnswerRe: read/recieve data from serial port Pin
Luc Pattyn26-Nov-10 0:56
sitebuilderLuc Pattyn26-Nov-10 0:56 
AnswerRe: read/recieve data from serial port Pin
Dave Kreskowiak26-Nov-10 6:13
mveDave Kreskowiak26-Nov-10 6:13 
QuestionVB.Net - Crystal report direct to printer. Missing parameter values [modified] Pin
Central_IT25-Nov-10 3:11
Central_IT25-Nov-10 3:11 
AnswerRe: VB.Net - Crystal report direct to printer. Missing parameter values Pin
ChandraRam26-Nov-10 1:14
ChandraRam26-Nov-10 1:14 
GeneralRe: VB.Net - Crystal report direct to printer. Missing parameter values Pin
Central_IT26-Nov-10 1:34
Central_IT26-Nov-10 1:34 
GeneralRe: VB.Net - Crystal report direct to printer. Missing parameter values Pin
DJ Matthews26-Nov-10 3:19
DJ Matthews26-Nov-10 3:19 
GeneralRe: VB.Net - Crystal report direct to printer. Missing parameter values Pin
Central_IT26-Nov-10 3:36
Central_IT26-Nov-10 3:36 
GeneralRe: VB.Net - Crystal report direct to printer. Missing parameter values Pin
Henry Minute29-Nov-10 1:23
Henry Minute29-Nov-10 1:23 
QuestionProblem while Publishing the application [SOLVED] Pin
vijay248224-Nov-10 22:38
vijay248224-Nov-10 22:38 
AnswerRe: Problem while Publishing the application Pin
Dave Kreskowiak25-Nov-10 2:58
mveDave Kreskowiak25-Nov-10 2:58 
GeneralRe: Problem while Publishing the application Pin
vijay248225-Nov-10 3:13
vijay248225-Nov-10 3:13 
GeneralRe: Problem while Publishing the application Pin
Dave Kreskowiak25-Nov-10 5:43
mveDave Kreskowiak25-Nov-10 5:43 
GeneralRe: Problem while Publishing the application Pin
vijay248225-Nov-10 3:36
vijay248225-Nov-10 3:36 
GeneralRe: Problem while Publishing the application Pin
Dave Kreskowiak25-Nov-10 5:48
mveDave Kreskowiak25-Nov-10 5:48 
GeneralRe: Problem while Publishing the application Pin
vijay248225-Nov-10 22:22
vijay248225-Nov-10 22:22 
GeneralRe: Problem while Publishing the application Pin
Dave Kreskowiak26-Nov-10 6:07
mveDave Kreskowiak26-Nov-10 6:07 
Questionaccess report to pdf Pin
C#Coudou24-Nov-10 14:35
C#Coudou24-Nov-10 14:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.