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!

bago pa lang ako sa vb.net...meron po ba kayong sample na simple calculator program para mapag-aralan at ma modify ko.?
 
bago pa lang ako sa vb.net...meron po ba kayong sample na simple calculator program para mapag-aralan at ma modify ko.?

try mo to
http://homeandlearn.co.uk/NET/nets1p17.html

pero kung ako sayo, ill try to do it na walang sinusundan na sample.

ano na alam mo?
alam mo na pano maglagay ng
textbox1.text = "5"
pag nag click ng number 5

alam mo na rin gagawin pag nag click ng + at =
alam mo na rin ang x = a + b
x = textbox1.text + value


anyway, i suggest basahin mo yung link na binigay ko, understand the concept,
then without looking at the code, try to do it on your own

maniwala ka, sasakit man ang ulo mo pero masarap ang feeling pag nagawa mo.
 
thanks po...first ko pa pong gumamit nang vb.net..at kasisimula pa lang nang klase..so i hope na gagaling din ako..ahmm..anyway..na-aaplay ba talaga ang oop of vb.net ngayon?
 
ito po ung sms reader/sender ko. na ipost ko sa vb6 na thread heheh, may instructions po dyan pano gamitin ung class.

class lang po yan ha hindi po program.
 

Attachments

  • SMS ReaderSender.rar
    8.4 KB · Views: 517
try multithreading din kung need ng project mo ang asynch processing

ginawa ko nlng po sya class para asynch ang processing. hindi rin po pwede gamitin ang threading pag may pass na values eh kaya sa class ako naglagay ng timer. and ayun nga it behaves differently sa windows.forms.timer.
 
thanks po...first ko pa pong gumamit nang vb.net..at kasisimula pa lang nang klase..so i hope na gagaling din ako..ahmm..anyway..na-aaplay ba talaga ang oop of vb.net ngayon?

start ka muna dito
http://homeandlearn.co.uk/NET/vbNet.html

OOP ang VB.NET,
halos lahat ng modern PL ay OOP na.

inaaply mo na yun without knowing it,
nasa language na yun.

btw, what is OOP ba sa pagkakaintindi mo?

review mo to, then tell us kung ganito ang VB.NET
http://en.wikipedia.org/wiki/Object-oriented_programming
http://en.wikibooks.org/wiki/Object_Oriented_Programming
 
ginawa ko nlng po sya class para asynch ang processing. hindi rin po pwede gamitin ang threading pag may pass na values eh kaya sa class ako naglagay ng timer. and ayun nga it behaves differently sa windows.forms.timer.

actually pwede;

pero sa case ng project mo, since kausap mo ay serial device, isang process lang pde kumausap sa kanya.

pero pwede mo ipasok sa thread yung process after makuha yung message:
for example;
specific message >>> may specific task
so you can run that task and read sms from the modem at the same time.

ang ginawa ko dati sa isang project ay yung SMS reader ay nasa isang thread,
ikot lang ng ikot, basa ng basa ng SMS,
since nasa isang bakcground thread sya, walng effect sa GUI at ibang process.
then pag may new SMS, i pass nya yung message sa isang process.

anyway, ok yang ginawa mo, pero what happens if
walang load yung sim?
walang signal?
invalid number?
do you return an error kung di nakapagsend

POINT IS: Keep on improving.....
Madami ka pde pag-gamitan nyan.

meron ako dati error mesages mg modem, di ko na mahanap, andami nun.
 
Last edited:
actually pwede;

pero sa case ng project mo, since kausap mo ay serial device, isang process lang pde kumausap sa kanya.

pero pwede mo ipasok sa thread yung process after makuha yung message:
for example;
specific message >>> may specific task
so you can run that task and read sms from the modem at the same time.

ang ginawa ko dati sa isang project ay yung SMS reader ay nasa isang thread,
ikot lang ng ikot, basa ng basa ng SMS,
since nasa isang bakcground thread sya, walng effect sa GUI at ibang process.
then pag may new SMS, i pass nya yung message sa isang process.

anyway, ok yang ginawa mo, pero what happens if
walang load yung sim?
walang signal?
do you return an error kung di nakapagsend
invalid number?

meron ako dati error mesages mg modem, di ko na mahanap, andami nun.

ganun din po gawa ko, nsa background lang read ng read tapos lagay ng lagay sa table, when sending stop ko reading, start konlng sya ulit after masend.

yan po mga kulang ko error trapping, lahat ng error ang nireturn ko is "error sending" so far sa gui ko nlng kinocontrol ung iba dapat gawin pero ung class na ginawa ko po eh try lang send once. ill improve it nlng as time goes by.

thanks po
 
ganun din po gawa ko, nsa background lang read ng read tapos lagay ng lagay sa table, when sending stop ko reading, start konlng sya ulit after masend.

yan po mga kulang ko error trapping, lahat ng error ang nireturn ko is "error sending" so far sa gui ko nlng kinocontrol ung iba dapat gawin pero ung class na ginawa ko po eh try lang send once. ill improve it nlng as time goes by.

thanks po

i kwento ko lang sayo yung adventure ko sa SMS development:

long time ago....
NOKIA32 GSM Modem ang gamit ko
trial and error, VB6, basic forms palang, simple serial comm, AT Commands

then pinasalubungan ako ng boss ko ng WAVECOMM GSM Modem
meron akong mga codes na binago kasi mas flexible at mas madami supported ang wavecomm

then ginawa kong class sa vb6, still ganun parin
ginamit na namin sa tunay na application, para sa GCASH to noon
then meron pa sumunod, SMS Banking yata and others
still, every project kelangan ko i modify halos lahat ng code

then another modem, RoundSolutions naman
then from China, Teltonica at Huawei

nagsawa na ako kakagawa ng code

tapos nilipat ko sa .NET
may nakita akong project sa internet, gawa sa c#, i improved and modified it.
ginawa kong isang SMS Engine na capable of multiple modems, so isang program can command like 4 modems at once.
this is created as parang SERVICE, running lang sa likod.

other programs will communicate sa service na to using TCP/IP, MSMQ or via database to send, list or read SMS

so far nandun 24/7 na tumatakbo sa server, ginagamit sa SMS banking, notifications ng fund transfer at ewan king ano pa ang gamit ngayon

so for any new project, i just create the GUI and the business intelligence tapos connect na sa SMS Engine.

like yung isang project na walang pambili ng modem
we ended up using 6 USB Modems ng Broadband,
para sa loading business naman to.


this is inspired by ESET antivirus, eset has separate GUI for front end,
yung AV Engine nya is running as service, the 2 parts talks in TCP/IP channel
 
start ka muna dito
http://homeandlearn.co.uk/NET/vbNet.html

OOP ang VB.NET,
halos lahat ng modern PL ay OOP na.

inaaply mo na yun without knowing it,
nasa language na yun.

btw, what is OOP ba sa pagkakaintindi mo?

review mo to, then tell us kung ganito ang VB.NET
http://en.wikipedia.org/wiki/Object-oriented_programming
http://en.wikibooks.org/wiki/Object_Oriented_Programming

para sa akin..ang oop have to deal with objects like the gui's pero in the way of programming
 
as i said i presented 3 ways to do it, look at method3.

malamang naka bound ka sa isang design time datasource. i dont do that,
wala masyado control sa runtime pag ganun.
madami ka di pde gawin pag naka bound na yung grid.
which you will see as the samples progress.

what im showing here is also applicable to other controls not just datagridview.
and i want to show rin how it is done in code

the code is not only for datagridview, you can use the code in other operations as well.

if you have a better code to share then tignan natin, you can open your file naman sa notepad muna so we can see it.
baka di ko pa alam yang method mo.
share tayo ng mag codes and techniques. this is what this forum is for.

Public Function getStudent() As DataTable
If con.State = ConnectionState.Open Then con.Close()

con.Open()
cmd = New OleDbCommand("Select * from Students order by StudentID asc", con)
da = New OleDbDataAdapter(cmd)
da.Fill(ds, "Students")

Return ds.Tables("Students")
con.Close()
End Function

ganyan po ang paggawa ko! Datasource nga ang gamit ko sa pag.populate ng datagrid.. And besides, di lang po sa datagrid siya applicable... I know mas expert ka dito, e yan po ang natutunan ko! Tzk3.. Dyan po ako comfortable.. Hehehe! Paturo namn kung pano gumawa ng SMS app at pg.connect nito sa Internet! Wla kasi kaming project na ganyan, gustohin ko man, kakagraduate ko lang! tzk3..
 
ganyan po ang paggawa ko! Datasource nga ang gamit ko sa pag.populate ng datagrid.. And besides, di lang po sa datagrid siya applicable... I know mas expert ka dito, e yan po ang natutunan ko! Tzk3.. Dyan po ako comfortable.. Hehehe! Paturo namn kung pano gumawa ng SMS app at pg.connect nito sa Internet! Wla kasi kaming project na ganyan, gustohin ko man, kakagraduate ko lang! tzk3..

Eehe, same din lang naman code natin, Connection, Command and adapter
yung nakita mong sobra are ways to format the datagrid.

kung ginamit mo yang code mo as is, walang formatting yung datagrid mo,
i used a reader to format each column for each row.

yes less code yung sayo pero not the output that i wanted.
then i used USING para automatic madispose ang object

sa method mo, yung RowsAdded Event ay di matrigger,
dun din ako naglalagay ng additional formatting.

try mo to:
using your code, populate a datagridview,
then on last column, put a counter with even numbers (2,4,6,8) for each rows.
lets see kung magagawa mo yan using your code.

point is, good presentation needs more code that usual.

regarding sa SMS app, just ask what you need to know,
wala kasi sa plan ko mag build ng ganun for a tuturial.
 
i kwento ko lang sayo yung adventure ko sa SMS development:

long time ago....
NOKIA32 GSM Modem ang gamit ko
trial and error, VB6, basic forms palang, simple serial comm, AT Commands

then pinasalubungan ako ng boss ko ng WAVECOMM GSM Modem
meron akong mga codes na binago kasi mas flexible at mas madami supported ang wavecomm

then ginawa kong class sa vb6, still ganun parin
ginamit na namin sa tunay na application, para sa GCASH to noon
then meron pa sumunod, SMS Banking yata and others
still, every project kelangan ko i modify halos lahat ng code

then another modem, RoundSolutions naman
then from China, Teltonica at Huawei

nagsawa na ako kakagawa ng code

tapos nilipat ko sa .NET
may nakita akong project sa internet, gawa sa c#, i improved and modified it.
ginawa kong isang SMS Engine na capable of multiple modems, so isang program can command like 4 modems at once.
this is created as parang SERVICE, running lang sa likod.

other programs will communicate sa service na to using TCP/IP, MSMQ or via database to send, list or read SMS

so far nandun 24/7 na tumatakbo sa server, ginagamit sa SMS banking, notifications ng fund transfer at ewan king ano pa ang gamit ngayon

so for any new project, i just create the GUI and the business intelligence tapos connect na sa SMS Engine.

like yung isang project na walang pambili ng modem
we ended up using 6 USB Modems ng Broadband,
para sa loading business naman to.


this is inspired by ESET antivirus, eset has separate GUI for front end,
yung AV Engine nya is running as service, the 2 parts talks in TCP/IP channel


thats nice, I tried na din sa wavecom and i agree its better we have 8 here sa office pero ginagamit sa ibang project nghiram lang kami for starters pero since di pa namin talaga sure kung magiging successful ung project i proposed na we use first broadband modems para lower ang cost then we plan on moving up sa wavecom pag dumami ang inquiries thru text.

anyway as you said challenging nga ang sms, actually kala ko nung una sobrand dali lang hehehe i thought kaya ko ng 1 week to study and finish it pero I ended up a making only that much on month.

mag popost nlng po me pag may other problems ako na ma encounter thanks po sa tulong.
 
SECOND POST : Very Basic Sample to connect to MSAccess Database
Includes Connection Builder menu to create connection string
Includes query execution
Displays result in a datagridview

Ginawa ko to para maintindihan ang mga object na ginagamit to connect sa Access database

MORE UPDATES TO COME kung madami makikinabang, otherwise gawa tayo ng iba.
attachment.php



attachment.php


attachment.php


just ask related questions pag di nyo naintindihan.

just ignore the ConnectionBuilder project,
maintenance functions lang yun
like creating connection strings and listing tables sa database
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    44.5 KB · Views: 4,425
  • Capture2.PNG
    Capture2.PNG
    37.4 KB · Views: 4,420
  • Capture3.PNG
    Capture3.PNG
    74 KB · Views: 4,429
  • ericVBNETAccessBasicTutorial.rar
    891.3 KB · Views: 4,497
@ericgmejia
nice tutorials there sir,
very much understandable even bago ka sa VB.net
kailangan na lang nila magexperiment ng konti para maintindihan nila ang behavior ng bawat ng bawat objects...

keep it up sir...
ill try to help pag may time ako,

hehehe as for your SMS Engine,
naka VB.net na din ba xa?

Pwd makahingi ng source code,
kahit yung pang prepaid modem kits lang ang gamit,

hahaha
gusto ko lang po mapagaralan,
tnx
 
@ericgmejia
nice tutorials there sir,
very much understandable even bago ka sa VB.net
kailangan na lang nila magexperiment ng konti para maintindihan nila ang behavior ng bawat ng bawat objects...

keep it up sir...
ill try to help pag may time ako,

hehehe as for your SMS Engine,
naka VB.net na din ba xa?

Pwd makahingi ng source code,
kahit yung pang prepaid modem kits lang ang gamit,

hahaha
gusto ko lang po mapagaralan,
tnx


of course VB.NET yun:

i give source samples, not complete codes.
maglalabas din ako ng sample ng SMS dito eventually, step by step,

for now basic muna tayo

kung gusto mo na mapaghandaan, learn about
--System.IO.Ports namespace
--Serial Port Control (in toolbox)
--AT Commands
practice sending AT Commands using hyperterminal,
 
@sir eric

sana po mkabigay ung example ng multithreading na pwede mag pass ng parameters. kasi sa msdn walang parameter na pinapasa sa example.

ang iniisip ko po para mapass ang parameter sa ibang thread eh gagamit ng variable.

pagganto po kasi error.

dim trd as thread
trd = new thread(addressof somthing("ayaw"))

public sub somthing(variable as string)
msgbox(vairable)
end sub
 
@sir eric

sana po mkabigay ung example ng multithreading na pwede mag pass ng parameters. kasi sa msdn walang parameter na pinapasa sa example.

ang iniisip ko po para mapass ang parameter sa ibang thread eh gagamit ng variable.

pagganto po kasi error.

dim trd as thread
trd = new thread(addressof somthing("ayaw"))

public sub somthing(variable as string)
msgbox(vairable)
end sub


normally nga ganito ginagawa
NewThread = New Thread(AddressOf ProcessClientConnection)
NewThread.IsBackground = True
NewThread.Start()


ilagay mo sa thread yung class:
then sa NEW, lagay ka parameter
then call mo na yung method sa class

Code:
Public Class MyProcessClass
dim _Param as string =""
Friend Sub New(parameter1 as string)
.....
_Param = parameter
End Sub

Friend Sub DoProcess()
...
_Param = .........

End Sub

Friend ReadOnly Property ProcessResult as string
... return result of DoProcess
End Property

End Class


'function call form calling procedure

Code:
Private Function StartProcess as boolean
dim parameter as string = "test"
dim cProcess as New MyProcessClass(parameter) 'pass the parameter thru this
Dim t As New Thread(AddressOf cProcess.DoProcess)
t.Start() 'start the thread

'======== pwede mo lagyan ng timeout yung thread, lalo pag BLOCKING ang thread
 If t.Join(1000) Then
            If cx.ProcessResult Then
                Return True
            Else
                Return False
            End If
 Else
            Return False
 End If

End Function
'pag NON BLOCKING; pwede mo i attach sa eventhandler kung may event yung class mo
'para pag natapos yung thread, mag trigger yung event



**note: sa notepad lang ako nagtype, so may syntax error to, pero itoi yung basic steps
 
Last edited:
try mo to:
using your code, populate a datagridview,
then on last column, put a counter with even numbers (2,4,6,8) for each rows.
lets see kung magagawa mo yan using your code.

point is, good presentation needs more code that usual.

regarding sa SMS app, just ask what you need to know,
wala kasi sa plan ko mag build ng ganun for a tuturial.

ano po ibig sabihin nyo TS, I will filter the rows by even nos? or I will put the even nos in the last column in exact row?

Sa SMS app, kahit simple app lang po na nakapagsend ng real sms sa phone carrier natin.
 
Last edited:
Back
Top Bottom