Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

VB.NET Programming Corner!

ito po ok na sir , try ko rin po yung string builder :clap:

salamat talaga sir ! . :excited:
:

kaso sir , case sensitive , paano po gawing case unsensitive ? :excited:

ok na pala sir, gagamitin ko na lang yung OR :)

thanks po ulet ! :D
 
Last edited:
ito po ok na sir , try ko rin po yung string builder :clap:

salamat talaga sir ! . :excited:
:

kaso sir , case sensitive , paano po gawing case unsensitive ? :excited:

case sensitive talaga ang comparison sa vb
kaya nga ginawa natin lowercase pareho para maiwasan ng confusion
 
hhe, hello!! Good day!
Can I ask a favor for the software that I am making?

please help me, hhe,
I have 10 forms to run randomly , the names of each form is from
Easy1, Easy2……………………Easy10
And this randomnation will start when I click the start button,

well considerably, I really have to have 30 forms for the software, and the 10 forms that I am asking here with you all guys, is the forms that will run when I click the easy button to execute the easy forms to start the quiz, the other 20 forms is divided on the 2 buttons which is the “Normal”, and the “Hard”, hhe, I also have another button that will run all of the 30 forms with its name of “Play ALL”, and what I need is the code for all of it,
I need them all to execute and run randomly, without repetition,
and on every forms or questions, it haves 3 lives that when I clciked the wrong button, it will less to the 3 lives until it gets to zero and open the Game Over button, that will again start at the beginning.

here is one of the form, I have
164491_533142693397557_2107943886_n.jpg


And the code

481867_533142930064200_1903433367_n.jpg



Public Class Quiz1a
Const QuestionCount As Integer = 10
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim QuestionList As List(Of Integer) = GenerateUnique(QuestionCount, 1, QuestionCount)

For Each x As Integer In QuestionList
Dim frm As Form = DirectCast(Activator.CreateInstance(Type.GetType(String.Format("{0}.{1}{2}", "software", "Easy", x))), Form)
frm.ShowDialog()


Next
End Sub
Private Shared Function GenerateUnique(ByVal LoopCount As Integer, ByVal rMin As Integer, ByVal rMax As Integer) As List(Of Integer)
Dim holder As New HashSet(Of Integer)
Dim rand As New Random
Do
holder.Add(rand.Next(rMin, rMax + 1))
Loop Until holder.Count = 10
Return holder.ToList
End Function
End Class



Public Class Easy1
Public Count As Integer
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
score += 5
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End Sub

Private Sub Easy1_Load_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Count = Label2.Text
End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End Sub
End Class
 
Last edited:
hhe, hello!! Good day!
Can I ask a favor for the software that I am making?

please help me, hhe,
I have 10 forms to run randomly , the names of each form is from
Easy1, Easy2……………………Easy10
And this randomnation will start when I click the start button,

well considerably, I really have to have 30 forms for the software, and the 10 forms that I am asking here with you all guys, is the forms that will run when I click the easy button to execute the easy forms to start the quiz, the other 20 forms is divided on the 2 buttons which is the “Normal”, and the “Hard”, hhe, I also have another button that will run all of the 30 forms with its name of “Play ALL”, and what I need is the code for all of it,
I need them all to execute and run randomly, without repetition,
and on every forms or questions, it haves 3 lives that when I clciked the wrong button, it will less to the 3 lives until it gets to zero and open the Game Over button, that will again start at the beginning.

here is one of the form, I have
164491_533142693397557_2107943886_n.jpg


And the code

481867_533142930064200_1903433367_n.jpg



Public Class Quiz1a
Const QuestionCount As Integer = 10
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim QuestionList As List(Of Integer) = GenerateUnique(QuestionCount, 1, QuestionCount)

For Each x As Integer In QuestionList
Dim frm As Form = DirectCast(Activator.CreateInstance(Type.GetType(String.Format("{0}.{1}{2}", "software", "Easy", x))), Form)
frm.ShowDialog()


Next
End Sub
Private Shared Function GenerateUnique(ByVal LoopCount As Integer, ByVal rMin As Integer, ByVal rMax As Integer) As List(Of Integer)
Dim holder As New HashSet(Of Integer)
Dim rand As New Random
Do
holder.Add(rand.Next(rMin, rMax + 1))
Loop Until holder.Count = 10
Return holder.ToList
End Function
End Class



Public Class Easy1
Public Count As Integer
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
score += 5
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End Sub

Private Sub Easy1_Load_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Count = Label2.Text
End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End Sub
End Class


what is the real goal of your app?

having 30 forms na slightly different from each other ir resource consuming,
if you can explain the real goal of this app baka meron approach na mas simple

like using 1 form and inheriting it

having an app opne 20 forms on my desktop is a nightmare,
i close ko agad yan and never to run that kind of app again
just sayin'
 
hhe, hello!! Good day!
Can I ask a favor for the software that I am making?

please help me, hhe,
I have 10 forms to run randomly , the names of each form is from
Easy1, Easy2……………………Easy10
And this randomnation will start when I click the start button,

well considerably, I really have to have 30 forms for the software, and the 10 forms that I am asking here with you all guys, is the forms that will run when I click the easy button to execute the easy forms to start the quiz, the other 20 forms is divided on the 2 buttons which is the “Normal”, and the “Hard”, hhe, I also have another button that will run all of the 30 forms with its name of “Play ALL”, and what I need is the code for all of it,
I need them all to execute and run randomly, without repetition,
and on every forms or questions, it haves 3 lives that when I clciked the wrong button, it will less to the 3 lives until it gets to zero and open the Game Over button, that will again start at the beginning.

here is one of the form, I have
164491_533142693397557_2107943886_n.jpg


And the code

481867_533142930064200_1903433367_n.jpg



Public Class Quiz1a
Const QuestionCount As Integer = 10
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim QuestionList As List(Of Integer) = GenerateUnique(QuestionCount, 1, QuestionCount)

For Each x As Integer In QuestionList
Dim frm As Form = DirectCast(Activator.CreateInstance(Type.GetType(String.Format("{0}.{1}{2}", "software", "Easy", x))), Form)
frm.ShowDialog()


Next
End Sub
Private Shared Function GenerateUnique(ByVal LoopCount As Integer, ByVal rMin As Integer, ByVal rMax As Integer) As List(Of Integer)
Dim holder As New HashSet(Of Integer)
Dim rand As New Random
Do
holder.Add(rand.Next(rMin, rMax + 1))
Loop Until holder.Count = 10
Return holder.ToList
End Function
End Class



Public Class Easy1
Public Count As Integer
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
score += 5
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End Sub

Private Sub Easy1_Load_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Count = Label2.Text
End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Count -= 1
Label2.Text = Str(Count)
Easy2.Label2.Text = Label2.Visible
Easy3.Label2.Text = Label2.Text
Easy4.Label2.Text = Label2.Text
Easy5.Label2.Text = Label2.Text
Easy6.Label2.Text = Label2.Text
Easy8.Label2.Text = Label2.Text
Easy7.Label2.Text = Label2.Text
Easy9.Label2.Text = Label2.Text
Easy10.Label2.Text = Label2.Text
If Label2.Text = 0 Then
GameOver.ShowDialog()
Me.Close()
End If
End Sub
End Class

ok. base on the code on Easy1, the code was not handled nicely. just pass the parameter to the parent.

ex.

easy1 has a public variable, lets say AnswerIsCorrect as Boolean.

after ng line frm.ShowDialog() saka mo e evaluate ang AnswerIsCorrect to have a running total. that way, hindi masyado mahaba ang code for each form, then to free resources, e dispose ang form before sya pupunta sa next item sa loop...

ts has a point, rather than having all 30 forms, make a generic form to call, then just replace the text in each button.

but thats your program... its your choice...

about sa 30 form,

Increase questionCount = 30, you might want this to be dynamic, pag click ng easy, = 10, pag click ng all = 30. then gawin mo nalang easy11 to easy20 (medium) and easy21 to easy30 (hard)

pag medium update mo ang line na to GenerateUnique(questioncount, 11, questioncount) and 21 for hard.

i'm not here to change what you have created (its your creativity) i'm here to help fix your creativeness...
 
what is the real goal of your app?

having 30 forms na slightly different from each other ir resource consuming,
if you can explain the real goal of this app baka meron approach na mas simple

like using 1 form and inheriting it

having an app opne 20 forms on my desktop is a nightmare,
i close ko agad yan and never to run that kind of app again
just sayin'

hhe, that is my proposal for passing our software..hhe I really need it please help
 
ok. base on the code on Easy1, the code was not handled nicely. just pass the parameter to the parent.

ex.

easy1 has a public variable, lets say AnswerIsCorrect as Boolean.

after ng line frm.ShowDialog() saka mo e evaluate ang AnswerIsCorrect to have a running total. that way, hindi masyado mahaba ang code for each form, then to free resources, e dispose ang form before sya pupunta sa next item sa loop...

ts has a point, rather than having all 30 forms, make a generic form to call, then just replace the text in each button.

but thats your program... its your choice...

about sa 30 form,

Increase questionCount = 30, you might want this to be dynamic, pag click ng easy, = 10, pag click ng all = 30. then gawin mo nalang easy11 to easy20 (medium) and easy21 to easy30 (hard)

pag medium update mo ang line na to GenerateUnique(questioncount, 11, questioncount) and 21 for hard.

i'm not here to change what you have created (its your creativity) i'm here to help fix your creativeness...

oh, but how? can you give me a clean code for it, hhe

I am so stressed with it, I will pass it a day after tomorrow.. :)
 
ok. base on the code on Easy1, the code was not handled nicely. just pass the parameter to the parent.

ex.

easy1 has a public variable, lets say AnswerIsCorrect as Boolean.

after ng line frm.ShowDialog() saka mo e evaluate ang AnswerIsCorrect to have a running total. that way, hindi masyado mahaba ang code for each form, then to free resources, e dispose ang form before sya pupunta sa next item sa loop...

ts has a point, rather than having all 30 forms, make a generic form to call, then just replace the text in each button.

but thats your program... its your choice...

about sa 30 form,

Increase questionCount = 30, you might want this to be dynamic, pag click ng easy, = 10, pag click ng all = 30. then gawin mo nalang easy11 to easy20 (medium) and easy21 to easy30 (hard)

pag medium update mo ang line na to GenerateUnique(questioncount, 11, questioncount) and 21 for hard.

i'm not here to change what you have created (its your creativity) i'm here to help fix your creativeness...

oh, another problem is I don't know the best code for what ts have said, hhe

I tried it by I can't process or enabled the program that should be executed.. :)

help! I know you can do it, hhe:praise:
 
oh, another problem is I don't know the best code for what ts have said, hhe

I tried it by I can't process or enabled the program that should be executed.. :)

help! I know you can do it, hhe:praise:

what kind of help do you need exactly?
 
what kind of help do you need exactly?

hhe, if you can give me the code for that, then it will be..

but if you see that there's better way than that, I will accept the idea you have given, :)

but if you can. please give also the first one I have asked.. thanks.. :):help:
 
pwede po magpaturo about sa dynamic controls?

ung pinagawang activity kasi nmin is ganito:

kung ilan ung illgagy nmin sa textbox Assume that

Textbox1.Text = 'laman ng textbox' <---kung ilan ung illgay ko dito ay un dn ang lalabas sa textbox in a column...so lets say na kapag naglagay ako ng 1 sa Textbox1 bali 5 textboxes (left to right) kpag 2 nmn 5 textboxes left to right and 2 box in a row

thx po sa sagot
 
pwede po magpaturo about sa dynamic controls?

ung pinagawang activity kasi nmin is ganito:

kung ilan ung illgagy nmin sa textbox Assume that

Textbox1.Text = 'laman ng textbox' <---kung ilan ung illgay ko dito ay un dn ang lalabas sa textbox in a column...so lets say na kapag naglagay ako ng 1 sa Textbox1 bali 5 textboxes (left to right) kpag 2 nmn 5 textboxes left to right and 2 box in a row

thx po sa sagot

this is how you create a new textbox and add it to form or any container

Code:
 Private Sub NewText()
        Dim tx As New TextBox
        tx.Location = New Point(100, 20)
        tx.Size = New Size(10, 40)
        tx.Parent = Me
        tx.Visible = True
        AddHandler tx.TextChanged, AddressOf TextBoxTextChanged
    End Sub

'event
    Private Sub TextBoxTextChanged(sender As System.Object, e As System.EventArgs)

    End Sub
 
Pahelp mga sir, ito kasing code para sa mafill yung textbox pagpumili ng value sa combobox..
kaso ito isang value lng yung nalabas.. kung ano lang ang napiling Rows sya lang ang nalabas..
gusto ko sana kung ano yung napili kong IDNumber lalabas po yung corresponding value nito sa textbox..


Friend Class LoanApp

Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
Dim inc As Integer
Dim MaxRows As Integer
Dim max As String

Private Sub LoanApp_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim x As Integer
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & My.Application.Info.DirectoryPath.ToString() & "\Database\Coop.mdb;"
sql = "SELECT EmployeeIDNumber, LastName, FirstName, MiddleName FROM Members"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "Members")
max = ds.Tables("Members").Rows.Count
For x = 0 To max - 1
cboEmployeeIDNumber.Items.Add(ds.Tables("Members").Rows(x).Item(0))
Next
con.Close()
MaxRows = ds.Tables("Members").Rows.Count
inc = -1
End Sub

Private Sub cboEmployeeIDNumber_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboEmployeeIDNumber.SelectedIndexChanged
Me.txtLastName.Text = ds.Tables("Members").Rows(0).Item("LastName")
Me.txtFirstName.Text = ds.Tables("Members").Rows(0).Item("FirstName")
Me.txtMiddleName.Text = ds.Tables("Members").Rows(0).Item("MiddleName")
End Sub
End Class
 
Pahelp mga sir, ito kasing code para sa mafill yung textbox pagpumili ng value sa combobox..
kaso ito isang value lng yung nalabas.. kung ano lang ang napiling Rows sya lang ang nalabas..
gusto ko sana kung ano yung napili kong IDNumber lalabas po yung corresponding value nito sa textbox..


Friend Class LoanApp

Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
Dim inc As Integer
Dim MaxRows As Integer
Dim max As String

Private Sub LoanApp_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim x As Integer
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & My.Application.Info.DirectoryPath.ToString() & "\Database\Coop.mdb;"
sql = "SELECT EmployeeIDNumber, LastName, FirstName, MiddleName FROM Members"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "Members")
max = ds.Tables("Members").Rows.Count
For x = 0 To max - 1
cboEmployeeIDNumber.Items.Add(ds.Tables("Members").Rows(x).Item(0))
Next
con.Close()
MaxRows = ds.Tables("Members").Rows.Count
inc = -1
End Sub

Private Sub cboEmployeeIDNumber_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboEmployeeIDNumber.SelectedIndexChanged
Me.txtLastName.Text = ds.Tables("Members").Rows(0).Item("LastName")
Me.txtFirstName.Text = ds.Tables("Members").Rows(0).Item("FirstName")
Me.txtMiddleName.Text = ds.Tables("Members").Rows(0).Item("MiddleName")
End Sub
End Class

gawin mong function yung nasa Form Load Event para ma call sa cboEmployeeIDNumber_SelectedIndexChanged event
lagyan mo ng parameter pa para sa ID

like;

Private Function GetData(IDNumber as String)
Dim x As Integer
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & My.Application.Info.DirectoryPath.ToString() & "\Database\Coop.mdb;"
sql = "SELECT EmployeeIDNumber, LastName, FirstName, MiddleName FROM Members WHERE EmployeeIDNumber = "' & IDNumber & "'"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "Members")
max = ds.Tables("Members").Rows.Count
For x = 0 To max - 1
cboEmployeeIDNumber.Items.Add(ds.Tables("Members").Rows(x).Item(0))
Next
con.Close()
MaxRows = ds.Tables("Members").Rows.Count
inc = -1
End Function

Private Sub cboEmployeeIDNumber_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboEmployeeIDNumber.SelectedIndexChanged
GetData cboEmployeeIDNumber.Text
Me.txtLastName.Text = ds.Tables("Members").Rows(0).Item("LastName")
Me.txtFirstName.Text = ds.Tables("Members").Rows(0).Item("FirstName")
Me.txtMiddleName.Text = ds.Tables("Members").Rows(0).Item("MiddleName")
End Sub
 
sa "SelectedIndexChanged" event ng combobox tawagin mo yung code na naga populate sa listview, with the value of combo as parameter

Code:
  Private Sub ComboBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
    PopulationTheList(ComboBox1.Text)
    End Sub

Private Sub PopulationTheList(pYEarLevel as string)
code blah
End Sub


Thank you po sir. :yipee: :) sa uulitin. hehe.:clap:
 
patulong po sa RFID tag..
ayaw po mastore o macopy yung 1st character( yung pabaligtad na "L") nung rfid tag sa database..nvarchar na yung datatype na ginamit ko pero ayaw pa din, gumamit na rin ako ng ibang datatypes :( gagamitin ko kasi yung rfid sa paglogin pero di sya nagana....yung pagsisisave kasi sa database eh ayaw nya tanggapin yung special character na yun..

rfid.png


eto lang po naisip kong solusyon:
1. letters/numbers lang pwede tanggapin ng textbox
2. maremove yung special characters pagkasalpak nung RFID card sa Reader at iinput sya sa ibang textbox then save sa database...

pero di ko alam..madami na po ako nasearch na codes kay google pero wala ako nakuha :(

paano po tanggalin yung 1st character na yun? o paano makuha lahat yung letters/numbers except yung mga special character?

vb.net po lang. na gamit ko. salamat po sa tutulong :salute:
 
Last edited:
Pahelp mga sir, ito kasing code para sa mafill yung textbox pagpumili ng value sa combobox..
kaso ito isang value lng yung nalabas.. kung ano lang ang napiling Rows sya lang ang nalabas..
gusto ko sana kung ano yung napili kong IDNumber lalabas po yung corresponding value nito sa textbox..


Friend Class LoanApp

Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
Dim inc As Integer
Dim MaxRows As Integer
Dim max As String

Private Sub LoanApp_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim x As Integer
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & My.Application.Info.DirectoryPath.ToString() & "\Database\Coop.mdb;"
sql = "SELECT EmployeeIDNumber, LastName, FirstName, MiddleName FROM Members"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "Members")
max = ds.Tables("Members").Rows.Count
For x = 0 To max - 1
cboEmployeeIDNumber.Items.Add(ds.Tables("Members").Rows(x).Item(0))
Next
con.Close()
MaxRows = ds.Tables("Members").Rows.Count
inc = -1
End Sub

Private Sub cboEmployeeIDNumber_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboEmployeeIDNumber.SelectedIndexChanged
Me.txtLastName.Text = ds.Tables("Members").Rows(0).Item("LastName")
Me.txtFirstName.Text = ds.Tables("Members").Rows(0).Item("FirstName")
Me.txtMiddleName.Text = ds.Tables("Members").Rows(0).Item("MiddleName")
End Sub
End Class


since nilagayan mo ng ID No. ung combobox mo. at pag pili mo ng ID No n nandun s combobox ay lalabas s textbox ang Name, address or what so ever... pki check nung "Private Sub cboEmployeeIDNumber_SelectedIndexChanged" codes. inside that sub. my dataset k dun n ginamit mo dun s "Sub LoanApp" kung npansin mu ung red color n txt. ang na se-select lng nung code mo eh ung unang row s dataset mo. which is index 0 s dataset.

gwin mo ung sv ni sir erik.. at gwa k iba name ng dataset. pag nagamit mo n ang ds as dataset, since hnd k ng ds.dispose, andun prin ung data lng Load App mo. gwin mo s new dataset mo dsgetdata as dataset, pra hnd mag conflict ang mga data mo.

kc kpag hnd k nag dispose at ginamit mu ulit ung ds, madadagdagan ang tables s loob s loob nun. ds.table(1).row. at bka malito kp s mga tables s loob nya.

advise lng. mas ok kung after mo cla gmitin i-dispose mo. pra malinis.

con.close
con.dispose
ds.dispose
da.dispose
 
gawin mong function yung nasa Form Load Event para ma call sa cboEmployeeIDNumber_SelectedIndexChanged event
lagyan mo ng parameter pa para sa ID

like;

Private Function GetData(IDNumber as String)
Dim x As Integer
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & My.Application.Info.DirectoryPath.ToString() & "\Database\Coop.mdb;"
sql = "SELECT EmployeeIDNumber, LastName, FirstName, MiddleName FROM Members WHERE EmployeeIDNumber = "' & IDNumber & "'"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "Members")
max = ds.Tables("Members").Rows.Count
For x = 0 To max - 1
cboEmployeeIDNumber.Items.Add(ds.Tables("Members").Rows(x).Item(0))
Next
con.Close()
MaxRows = ds.Tables("Members").Rows.Count
inc = -1
End Function

Private Sub cboEmployeeIDNumber_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboEmployeeIDNumber.SelectedIndexChanged
GetData cboEmployeeIDNumber.Text
Me.txtLastName.Text = ds.Tables("Members").Rows(0).Item("LastName")
Me.txtFirstName.Text = ds.Tables("Members").Rows(0).Item("FirstName")
Me.txtMiddleName.Text = ds.Tables("Members").Rows(0).Item("MiddleName")
End Sub

Um, di ko sir magets.. nung sinubukan ko yang codes na binigay nyo di na gumana.. pano po ito? :noidea:
 
Back
Top Bottom