oussama_1 39 Posting Whiz in Training

what if your device is assigned to com9 port and you are trying to open it on com1 and com2..for that you have to make sure what port it is, you can set it manually go to devices and printers- your device properties - port tab
or you can choose it programmatically by

IO.Ports.SerialPort.GetPortNames
oussama_1 39 Posting Whiz in Training

Before reading Mifare Were you able to connect to it?

oussama_1 39 Posting Whiz in Training

MsgBox is the default one, you show a string and wait for the user to click the msgbox button
in Messagebox.show you can add a custom buttons and icon etc..

MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
oussama_1 39 Posting Whiz in Training

Everything you need is in the code file, but first try to understand it
Click Here
Click Here

oussama_1 39 Posting Whiz in Training
Dim cmd As New OleDbCommand
cmd.Connection = connection
cmd.CommandType = CommandType.Text
cmd.CommandText = "DELETE FROM Table WHERE ColumnName =" & String & ""
connection.Open()
cmd.ExecuteNonQuery()
connection.Close()
oussama_1 39 Posting Whiz in Training

try the code in the file "MifareCardProg_1.txt" if you get any errors post it here

oussama_1 39 Posting Whiz in Training

That's it, copy the code and paste it in your vb project and you should add a reference to this "ModWinsCard64.SCARD".
now pay attention to this code

    Private Sub InitMenu()

        connActive = False
        cbReader.Items.Clear()
        cbReader.Text = ""
        mMsg.Items.Clear()
        displayOut(0, 0, "Program ready")
        bConnect.Enabled = False
        bInit.Enabled = True
        bReset.Enabled = False
        rbNonVolMem.Checked = False
        rbSource2.Checked = True
        rbVolMem.Checked = True
        tMemAdd.Text = ""
        tKey1.Text = ""
        tKey2.Text = ""
        tKey3.Text = ""
        tKey4.Text = ""
        tKey5.Text = ""
        tKey6.Text = ""
        gbLoadKeys.Enabled = False
        tBlkNo.Text = ""
        tKeyAdd.Text = ""
        gbAuth.Enabled = False
        tBinBlk.Text = ""
        tBinLen.Text = ""
        tBinData.Text = ""
        gbBinOps.Enabled = False
        tValAmt.Text = ""
        tValBlk.Text = ""
        tValSrc.Text = ""
        tValTar.Text = ""
        gbValBlk.Enabled = False

    End Sub

you need to add these controls to your form like "bConnect.Enabled = False" you need to add a button and name it bConnect and for this "tKey1.Text" add a textbox named tKey1 and for "mMsg.Items.Clear()" add a listbox mMsg etc..when you finish run your program and press connect and test your device..
with this code you can connect and display data, clear them and print them (side note: a Buffer is what holds your data to read them).
good luck

oussama_1 39 Posting Whiz in Training

usually a product like this comes with a software disc or you can download it from their website..if thats not the case, is there any part in that documentation that talks about developing or programing if so, upload it or send a url.
anyway this is how you read the data

  • connect it to your pc
  • add a SerialPort control to your VB form and a Combobox
  • get the name of the ports that are connected to your pc

    ComboBox1.Items.AddRange(IO.Ports.SerialPort.GetPortNames)

  • assign your devise to the serialport

    SerialPort1.PortName = ComboBox1.SelectedItem.ToString

  • open it

    SerialPort1.Open()

  • Receive data as bytes and convert to plain text

    Private Sub DataReceived(ByVal sender As Object, _
    ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _
    Handles SerialPort1.DataReceived
    If SerialPort1.BytesToRead > 0 Then
    SerialPort1.Read(your data "bytes")
    end if
    'convert bytes to plain text
    System.Text.Encoding.ASCII.GetString(your data)

good luck

oussama_1 39 Posting Whiz in Training

Read this

oussama_1 39 Posting Whiz in Training

lol, hope so :D
good luck

oussama_1 39 Posting Whiz in Training

since this thread is solved, daniweb members will visit this thread rarely so i recomand you start a new one. and i dont know the answer to your last question.
good luck

oussama_1 39 Posting Whiz in Training

No it's not, that's what you are missing you need to declare the connection string

oussama_1 39 Posting Whiz in Training

i once did a pos for a delivery company, they take orders over the phone so i included a caller id in the pos, you can try something like that..just for fun.

oussama_1 39 Posting Whiz in Training

a zero index actually can contain an item you should change your code to this
If ComboBox1.SelectedIndex > -1 Then

oussama_1 39 Posting Whiz in Training

Please post you "sqlConnString" declaration code.

oussama_1 39 Posting Whiz in Training

Yes you can try this

System.Data.DataSet

or this

dim datagrid as datagridview
oussama_1 39 Posting Whiz in Training

this one works and wont give any error if the item is not selected

ComboBox1.Items.Remove(ComboBox1.SelectedItem)

but this one will give you "InvalidArgument=Value of '-1' (not 0) is not valid for 'index'" if the item is not selected

ComboBox1.Items.RemoveAt(ComboBox1.SelectedIndex)
oussama_1 39 Posting Whiz in Training

Resume Button

    Dim minutes As String
    Dim seconds As String

    Private Sub ResumeTime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResumeTime.Click
        minutes = Label7.Text.Substring(0, 2)
        seconds = Label7.Text.Replace(minutes & ":", "")
        Timer3.Start()
    End Sub

Tick event

    Private Sub Timer3_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer3.Tick
        Dim timedifference As TimeSpan = DateTime.Now.AddMinutes(minutes).AddSeconds(seconds).Subtract(starttime)
        Dim newdate As DateTime = timedifference.ToString
        Label7.Text = newdate.ToString("mm:ss")
    End Sub
oussama_1 39 Posting Whiz in Training

in the timer tick event, you can also try if statement

    Private Sub Timer3_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer3.Tick
        If label7.text >= "45:00" Then
            Dim timedifference As TimeSpan = DateTime.Now.AddMinutes("45").Subtract(starttime)
            Dim newdate As DateTime = timedifference.ToString
            Label7.Text = newdate.ToString("mm:ss")
        Else
            Dim timedifference As TimeSpan = DateTime.Now.Subtract(starttime)
            Dim newdate As DateTime = timedifference.ToString
            Label7.Text = newdate.ToString("mm:ss")
        End If
    End Sub
oussama_1 39 Posting Whiz in Training
Dim timedifference As TimeSpan = DateTime.Now.AddMinutes("45").Subtract(starttime)
oussama_1 39 Posting Whiz in Training

you are welcome

oussama_1 39 Posting Whiz in Training

the animation speed works when you set the style to Marquee.
i recommand that you put it on continuous and change the progressbar maximum value to let's say 90 and change the time interval to 3000 this will make the progressbar increases slower and smoother.
please mark question solved.

oussama_1 39 Posting Whiz in Training

both and change the style, i think "Continuous" is what you are looking for

oussama_1 39 Posting Whiz in Training

read my answer in this

oussama_1 39 Posting Whiz in Training

Use the animation speed.

oussama_1 39 Posting Whiz in Training

Hmm.. try this here

oussama_1 39 Posting Whiz in Training
    Private Sub Button7_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button7.Click
        'set your timer to minutes
        Timer2.Interval = 60000
        'set you progressbar max value to 45
        ProgressBar1.Maximum = 45
        Timer2.Start()
        Button7.Enabled = True
        Label8.Text = "Match Begins"
    End Sub

    Private Sub Timer2_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer2.Tick
        ProgressBar1.Increment(1)
        If ProgressBar1.Value = 1 Then
            Label8.Text = "1st Half"
        End If
        If ProgressBar1.Value = 45 Then
            Label8.Text = "Half-Time"
        End If
    End Sub
oussama_1 39 Posting Whiz in Training

@ddanbe my code is missing the details that's all.

oussama_1 39 Posting Whiz in Training

Use a webbrowser from toolbox menu

1 .. pass the address to the webpage

Webbrowser.Navigate(URL)

2 .. click the webpage (find) button

webBrowser1.Document.All("Button ID").InvokeMember("click")

Good Luck

oussama_1 39 Posting Whiz in Training

You can't, you have to rename them!

oussama_1 39 Posting Whiz in Training
        For i = 0 To 5
            Dim textbox As New TextBox
            textbox.Name = "Textbox(" & i & ")"
            Me.Controls.Add(textbox)
        Next

but the textboxes will be created on top of each other so add the location inside the loop

textboxe.Location = New Point(X,Y)

Good Luck

oussama_1 39 Posting Whiz in Training

Dim textbox As New ArrayList

oussama_1 39 Posting Whiz in Training

Typically in a program you find something called "Preferences" or "Option" or "Settings" this is the user section, the user own choice of inputs. use this in your program so you can get for example the access file path and password to use it in your connection string. so you need to save these inputs, how to do so?
there are two ways, the old way which you can save them in a .ini file or the new one that i recommand its my.settings
in your project properties go to settings and name a couple of settings like access and password. in your program when the user hit the save button for the option run this

'let's say you have 2 textboxes(dbfile and pass)
my.settings.access = dbfile.text
my.settings.password = pass.text
my.settings.save

therfore your connection string should be like this

"Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source='" & my.settings.access & "';" & "Persist Security Info=False;" & "Jet OLEDB:Database Password=" & my.settings.pass & ";"

now you can make the installer for your "EXE" program
go to your project properties >> publish >> publish wizard..

but before there are 2 thing to take care of:
1) when the user install your application the "application files" and "prerequisites" in the publish section will be automatically installed on the user machine
so make sure you include everything in the application files
2) the user machine platform
if the targeted machine is 64bit platform,you should assign your app …

oussama_1 39 Posting Whiz in Training

wow buddy your code doesn't make any sense.
you should run this once

    With dgv_booklist
        .Columns.Add("ISBN", "ISBN")
        .Columns.Add("BookCode", "BookCode")
        .Columns.Add("Title", "Title")
        .Columns.Add("Author", "Author")
        .Columns.Add("Category", "Category")
        .Columns.Add("StudentNo", "StudentNo")
        .Columns.Add("FirstName", "FirstName")
        .Columns.Add("LastName", "LastName")
        .Columns.Add("BorrowDate", "BorrowDate")
        .Columns.Add("LoanPeriod", "LoanPeriod")
    End With

and that's the add row code

Private Sub btn_addborrow_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_addborrow.Click
    dgv_booklist.Rows.Add(txtbox_isbn.Text, txtbox_code.Text, txtbox_title.Text, txtbox_author.Text, txtbox_category.Text, txtbox_studno.Text, txtbox_firstname.Text, txtbox_lastname.Text, dtp_borrowdate.Text, txtbox_loanperiod.Text)
End Sub
oussama_1 39 Posting Whiz in Training

in a button click event create 2 different connection(oleDb.oleDbConnection) like this

Dim Connection1 As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source='" & "Access 1 Full Path" & "';" & "Persist Security Info=False;" & "Jet OLEDB:Database Password=" & "your pass" & ";")



Dim Connection2 As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source='" & "Access 2 Full Path" & "';" & "Persist Security Info=False;" & "Jet OLEDB:Database Password=" & "your pass" & ";")

and of course different command for each table

        Dim cmd As OleDbCommand
        Dim dr As OleDbDataReader
        Try
            Connection1.Open()
            cmd = New OleDbCommand("SELECT *  from TableNameOfFirstAccess WHERE ID=" & ID.Text & "", Connection1)
            dr = cmd.ExecuteReader
            If dr.Read Then
                ID.Text = dr("ID")
                Age.Text = dr("Age")
                Sex.Text = dr("Sex")
                Name.Text = dr("Name")
            Else
                MsgBox("No Such Account")
            End If
        Catch
        End Try
        dr.Close()
        Connection1.Close()

        Try
            Connection2.Open()
            cmd = New OleDbCommand("SELECT *  from TableNameOfSecondAccess WHERE ID=" & ID.Text & "", Connection2)
            dr = cmd.ExecuteReader
            If dr.Read Then
                form2.Hb.Text = dr("Hb")
            Else
                MsgBox("No Such Account")
            End If
        Catch
        End Try
        dr.Close()
        Connection2.Close()
oussama_1 39 Posting Whiz in Training

if your question is solved then mark it as such. for the other question start a new thread.
Click Here

oussama_1 39 Posting Whiz in Training

Yes.

oussama_1 39 Posting Whiz in Training

make sure that this path exist:
start >> Run >> \PROD-PC\C$\BACKUP\
if it doesn't exist then you are goin to need to share your hard drive "C" then it'll appear in that directory "\PROD-PC".

oussama_1 39 Posting Whiz in Training

Instead of the ip address, type

"\\pcname"
oussama_1 39 Posting Whiz in Training

go to your project properties >>Publish >> Publish Wizard..

oussama_1 39 Posting Whiz in Training
oussama_1 39 Posting Whiz in Training

Please tell me the code.

Dear Satyam_1
What you are asking is for us to work for you instead of helping you, you see programmers get paid for these codes! Programmers spend a lot of money and years of their time studiyng these codes,don't take this the wrong way at least just show some effort (any kind of effort) so we can help you in our free time. Click Here
Good Luck

oussama_1 39 Posting Whiz in Training

like this ?

datagridview.rows(index).cells(index).value = dr.item("ID")
oussama_1 39 Posting Whiz in Training

oh, i recommand that you use a dictionary api but it depends if you can find one with the languages you want.

oussama_1 39 Posting Whiz in Training

can not find Path resource in textfile

well there is no path (you can get objets,strings.. from your resources).
my code works fine, your code shows that you want to copy a textfile from resources:

        System.IO.File.WriteAllBytes(FilePath & "\wsha.txt", My.Resources.wsha)

the streamReader wont work because your textfile in the resources is no longer a file so its not supported by system.io.streamReader. but you can import the text like this:

Dim lines() As String = My.Resources.wsha.Split(Environment.NewLine)
For Each line As String In lines
Richtextbox1.Text = Richtextbox1.Text & vbNewLine & line
Next

Good luck

oussama_1 39 Posting Whiz in Training
oussama_1 39 Posting Whiz in Training

There is no path to your resources it's already embeded in your exe app but instead you can use the text inside (only to copy)
Like this:

Dim Text As New RichTextBox
Dim FilePath As String = My.Computer.FileSystem.SpecialDirectories.Desktop
Dim lines() As String = My.Resources.wsha.Split(Environment.NewLine)
For Each line As String In lines
Text.Text = Text.Text & vbNewLine & line
Next
Dim Copy As New System.IO.StreamWriter(FilePath & "\wsha.txt")
Copy.Write(Text.Text)
Copy.Close()
oussama_1 39 Posting Whiz in Training

Put dr.close in here:

            If dr.Read Then
                form2.ID.Text = dr("ID")
                form2.Age.Text = dr("Age")
                form2.Sex.Text = dr("Sex")
                form2.Name.Text = dr("Name")
                form2.show()
                dr.Close()
            Else
                MsgBox("No Such Account")
            End If
        Catch
        End Try

        CN.Close()
oussama_1 39 Posting Whiz in Training

set timer to minutes : timer.Interval = 60000
on button click event put timer.start
in timer1_tick event each tick is a 1 minute so count the minutes
count = count + 1 and if count == 2 then alert and stop timer (timer.stop).
good luck

oussama_1 39 Posting Whiz in Training

oh ok..then you dont need to install anything just create the installer for the PCs and set up the right directories and you're good to go.