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!

try mong wag gumamit ng datareader login lng naman yan eh...
try datatable
Code:
if datable.rows.count > 0
or use excecutescalar
Code:
SELECT COUNT(*) FROM table WHERE username=@uname and password=@pass

dim x as integer
x=command.excecutescalar

if x >0 then
'logged in
else
'invalid password/username
end if


Inexecute mo kasi yung data reader mo ng dalawang beses (2x)

may "Cm.ExecuteReader" kana
meron ka pang "Cm.ExecuteNonQuery".
kaya sabi ng compiler sayo may naka open pa
 
tanong ko lang po TS kung pano gawin yung mag add nag number na kagawa nito

2+2+2+2 dapat ang sagot ay 8
yung sakin pag 2+2+2+2 = 4 lang
simple calculator po yung gnawa ko di ko magaya yung katulad sa mga calculator ng windows eh pa help naman po sa code big help po starting palang po kase ako ehh....
 
tanong ko lang po TS kung pano gawin yung mag add nag number na kagawa nito

2+2+2+2 dapat ang sagot ay 8
yung sakin pag 2+2+2+2 = 4 lang
simple calculator po yung gnawa ko di ko magaya yung katulad sa mga calculator ng windows eh pa help naman po sa code big help po starting palang po kase ako ehh....

Try mo ito Sir.

Code:
MsgBox(CDec(2 + 2 + 2 + 2)) : Exit Sub
 
Try mo ito Sir.

Code:
MsgBox(CDec(2 + 2 + 2 + 2)) : Exit Sub

salamat sa reply mo bro pero di yan yung need ko na code
ganto sample

Dim Num1 As Double = 0
Dim Num2 As Double = 0

dapat mag display ang answer kung saan ka mag input ng numbers

1 textbox lang ang gamit tignan mo yung calculator ng windows na OS pag nag add ka halimbawa

1+1+1+1 = 4 yan
sakin di ng process ang ngyayare
pag nag 1+1+1+1 ako = nyan 2 lang
di counted yung 1st and 2nd digit

yan ang prob ko try mo i check yung calculator ng windows para malaman mo yung ibig kong sabihin...
anyway thanks sa reply
 
Code:
DROP TRIGGER IF EXISTS bookremain$$
CREATE TRIGGER bookremain AFTER INSERT ON LibraryTransaction
FOR EACH ROW
BEGIN 
UPDATE BookInfo,LibraryTransaction SET BookInfo.BookRemaining = BookInfo.BookRemaining - LibraryTransaction.NoofCopy WHERE BookInfo.BookNo = LibraryTransaction.BookNo AND BookInfo.BookNo = New.BookNo;
END$$

mga sir panu po tamang syntax nitong trigger ko sa mysql..kasi ng uupdate nga siya kaso..patuloy siya sa pagkaltas..please help po..@@
 
Code:
DROP TRIGGER IF EXISTS bookremain$$
CREATE TRIGGER bookremain AFTER INSERT ON LibraryTransaction
FOR EACH ROW
BEGIN 
UPDATE BookInfo,LibraryTransaction SET BookInfo.BookRemaining = BookInfo.BookRemaining - LibraryTransaction.NoofCopy WHERE BookInfo.BookNo = LibraryTransaction.BookNo AND BookInfo.BookNo = New.BookNo;
END$$

mga sir panu po tamang syntax nitong trigger ko sa mysql..kasi ng uupdate nga siya kaso..patuloy siya sa pagkaltas..please help po..@@



Code:
CREATE TRIGGER bookremain AFTER INSERT ON LibraryTransaction
FOR EACH ROW
BEGIN 
UPDATE BookInfo,LibraryTransaction SET BookInfo.BookRemaining = BookInfo.BookRemaining - LibraryTransaction.NoofCopy WHERE BookInfo.BookNo = INSERTED.BookNo AND BookInfo.BookNo = INSERTED.BookNo;
END/CODE]
 
salamat sa reply mo bro pero di yan yung need ko na code
ganto sample

Dim Num1 As Double = 0
Dim Num2 As Double = 0

dapat mag display ang answer kung saan ka mag input ng numbers

1 textbox lang ang gamit tignan mo yung calculator ng windows na OS pag nag add ka halimbawa

1+1+1+1 = 4 yan
sakin di ng process ang ngyayare
pag nag 1+1+1+1 ako = nyan 2 lang
di counted yung 1st and 2nd digit

yan ang prob ko try mo i check yung calculator ng windows para malaman mo yung ibig kong sabihin...
anyway thanks sa reply

Post po Sir ang code mo. Para makita din namin kung saan ang problema.

Eto na try mo na po ba ito Sir?
Code:
       Dim oVal As Double
        Try
            oVal += TextBox1.Text

            TextBox1.Text = oVal
        Catch ex As Exception
            MsgBox(ex)
        End Try
 
Last edited:
Post po Sir ang code mo. Para makita din namin kung saan ang problema.

ito code ko paki check n lang po thanks

Public Class frmCalculator

Dim dAnswer As Double = 0
Dim dNumber1 As Double = 0
Dim dNumber2 As Double = 0
Dim sNumber As String = 0
Dim iSign As Integer = 0

Private Sub cmd2_Click(sender As System.Object, e As System.EventArgs) Handles cmd2.Click
txtnum1.Text = txtnum1.Text & "2"
txtnum2.Text = txtnum2.Text & "2"
End Sub

Private Sub cmd3_Click(sender As System.Object, e As System.EventArgs) Handles cmd3.Click
txtnum1.Text = txtnum1.Text & "3"
txtnum2.Text = txtnum2.Text & "3"
End Sub

Private Sub txtnum1_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtnum1.TextChanged

End Sub

Private Sub cmd1_Click_1(sender As System.Object, e As System.EventArgs) Handles cmd1.Click
txtnum1.Text = txtnum1.Text & "1"
txtnum2.Text = txtnum2.Text & "1"

End Sub

Private Sub cmd4_Click(sender As System.Object, e As System.EventArgs) Handles cmd4.Click
txtnum1.Text = txtnum1.Text & "4"
txtnum2.Text = txtnum2.Text & "4"
End Sub

Private Sub cmd5_Click(sender As System.Object, e As System.EventArgs) Handles cmd5.Click
txtnum1.Text = txtnum1.Text & "5"
txtnum2.Text = txtnum2.Text & "5"
End Sub

Private Sub cmd6_Click(sender As System.Object, e As System.EventArgs) Handles cmd6.Click
txtnum1.Text = txtnum1.Text & "6"
txtnum2.Text = txtnum2.Text & "6"
End Sub

Private Sub cmd7_Click(sender As System.Object, e As System.EventArgs) Handles cmd7.Click
txtnum1.Text = txtnum1.Text & "7"
txtnum2.Text = txtnum2.Text & "7"
End Sub

Private Sub cmd8_Click(sender As System.Object, e As System.EventArgs) Handles cmd8.Click
txtnum1.Text = txtnum1.Text & "8"
txtnum2.Text = txtnum2.Text & "8"
End Sub

Private Sub cmd9_Click(sender As System.Object, e As System.EventArgs) Handles cmd9.Click
txtnum1.Text = txtnum1.Text & "9"
txtnum2.Text = txtnum2.Text & "9"

End Sub

Private Sub cmd0_Click(sender As System.Object, e As System.EventArgs) Handles cmd0.Click
txtnum1.Text = txtnum1.Text & "0"
txtnum2.Text = txtnum2.Text & "0"


End Sub

Private Sub cmdEqual_Click(sender As System.Object, e As System.EventArgs) Handles cmdEqual.Click
dNumber2 = CDbl(txtnum1.Text)

If iSign = 1 Then
dAnswer = dNumber1 + dNumber2
ElseIf iSign = 2 Then
dAnswer = dNumber1 - dNumber2
ElseIf iSign = 3 Then
dAnswer = dNumber1 / dNumber2
ElseIf iSign = 4 Then
dAnswer = dNumber1 * dNumber2
End If

txtnum1.Text = dAnswer

End Sub



Private Sub cmdadd_Click(sender As System.Object, e As System.EventArgs) Handles cmdadd.Click
iSign = 1
dNumber1 = CDbl(txtnum1.Text)
txtnum2.Text = txtnum2.Text & " " & "+" & " "
txtnum1.Text = ""


dAnswer = dNumber1 + dNumber2
txtnum1.Text = dAnswer
txtnum1.Text = ""
End Sub

Private Sub cmdsub_Click(sender As System.Object, e As System.EventArgs) Handles cmdsub.Click
iSign = 2
dNumber1 = CDbl(txtnum1.Text)
txtnum2.Text = txtnum2.Text & " " & "-" & " "
txtnum1.Text = ""
End Sub

Private Sub cmddiv_Click(sender As System.Object, e As System.EventArgs) Handles cmddiv.Click
iSign = 3
dNumber1 = CDbl(txtnum1.Text)
txtnum2.Text = txtnum2.Text & " " & "/" & " "
txtnum1.Text = ""
End Sub

Private Sub cmdmul_Click(sender As System.Object, e As System.EventArgs) Handles cmdmul.Click
iSign = 4
dNumber1 = CDbl(txtnum1.Text)
txtnum2.Text = txtnum2.Text & " " & "*" & " "
txtnum1.Text = ""
End Sub

Private Sub txtnum2_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtnum2.TextChanged
txtnum2.Enabled = False

End Sub

Private Sub cmdclear_Click(sender As System.Object, e As System.EventArgs) Handles cmdclear.Click
txtnum1.Text = ""
txtnum2.Text = ""
End Sub

Private Sub frmCalculator_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

End Sub
End Class
 
Try mo itong post ko Sir, ilagay mo yan sa mga button mo. http://www.symbianize.com/showpost.php?p=13861839&postcount=5747

di parin po yan ehh wala pong message box n gagamitin textbox1 lang ang gagamitin check mo po yung calculator s windows OS mo para maintindihan mo po yung gusto ko ipaliwanag sensya na po nagpractice palang po kase ako ehh gusto ko mlaman kung pano gawin yung multi adding pero di nag error yung tipong lumalabas yung answer pag nagclick ka ng add substract or multiply... thanks po sa reply sir bryan:salute: :thumbsup:
 
di parin po yan ehh wala pong message box n gagamitin textbox1 lang ang gagamitin check mo po yung calculator s windows OS mo para maintindihan mo po yung gusto ko ipaliwanag sensya na po nagpractice palang po kase ako ehh gusto ko mlaman kung pano gawin yung multi adding pero di nag error yung tipong lumalabas yung answer pag nagclick ka ng add substract or multiply... thanks po sa reply sir bryan:salute: :thumbsup:

Analyze mo po yung code Sir, hindi yung tipong copy paste run.
Nag start din ako sa ganyan, pero ang ginagawa ko inaaral ko every line of code. Oh eto ginawan kita ng sample.
 

Attachments

  • WindowsApplication1.rar
    15.6 KB · Views: 5
Analyze mo po yung code Sir, hindi yung tipong copy paste run.
Nag start din ako sa ganyan, pero ang ginagawa ko inaaral ko every line of code. Oh eto ginawan kita ng sample.

thanks sir tanong ko lang meron bang command na ang gagawin eh first click normal operation ang mangyayare tapos sa second click gagana ang added na command??
 
thanks sir tanong ko lang meron bang command na ang gagawin eh first click normal operation ang mangyayare tapos sa second click gagana ang added na command??

Ano po ibig mong sabihin Sir sa normal operation?

Kung function lang po ng button meron po, lagyan mo lang po sila ng sariling command.

Click and DoubleClick.
 
thanks sir tanong ko lang meron bang command na ang gagawin eh first click normal operation ang mangyayare tapos sa second click gagana ang added na command??

to give you an idea...
ginawa ko lng to out of boredom kaya hindi natapos..
Code:
 Private Sub calc_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click, _
        btn2.Click, btn3.Click, btn4.Click, btn5.Click, btn6.Click, btn7.Click, btn8.Click, btn9.Click, btnAdd.Click, _
        btnSub.Click, btnMul.Click, btnDiv.Click, btnDel.Click, btnEquals.Click, btn0.Click, btnDec.Click
        Dim re As New Regex("\d+")
        Dim m As Match = re.Match(sender.ToString)

        Dim reOp As New Regex("[+\-*/=]")
        Dim mOP As Match = reOp.Match(sender.ToString)
        If mOP.Success Then

            Select Case mOP.Value
                Case "+"
                    txtInput.AppendText(btnAdd.Tag)
                Case "-"
                    txtInput.AppendText(btnSub.Tag)
                Case "*"
                    txtInput.AppendText(btnMul.Tag)
                Case "/"
                    txtInput.AppendText(btnDiv.Tag)
                Case "="

                    MsgBox(txtInput.Text)
            End Select

        End If



        If m.Success Then
            Select Case m.Value
                Case 1
                    If txtInput.Text = "0" Then
                        txtInput.Text = btn1.Tag
                    Else
                        txtInput.AppendText(btn1.Tag)
                    End If

                Case 2
                    If txtInput.Text = "0" Then
                        txtInput.Text = btn1.Tag
                    Else
                        txtInput.AppendText(btn2.Tag)
                    End If
                Case 3
                    If txtInput.Text = "0" Then
                        txtInput.Text = btn1.Tag
                    Else
                        txtInput.AppendText(btn3.Tag)
                    End If
                Case 4
                    If txtInput.Text = "0" Then
                        txtInput.Text = btn1.Tag
                    Else
                        txtInput.AppendText(btn4.Tag)
                    End If
                Case 5
                    If txtInput.Text = "0" Then
                        txtInput.Text = btn1.Tag
                    Else
                        txtInput.AppendText(btn5.Tag)
                    End If
                Case 6
                    If txtInput.Text = "0" Then
                        txtInput.Text = btn1.Tag
                    Else
                        txtInput.AppendText(btn6.Tag)
                    End If
                Case 7
                    If txtInput.Text = "0" Then
                        txtInput.Text = btn1.Tag
                    Else
                        txtInput.AppendText(btn7.Tag)
                    End If
                Case 8
                    If txtInput.Text = "0" Then
                        txtInput.Text = btn1.Tag
                    Else
                        txtInput.AppendText(btn8.Tag)
                    End If
                Case 9
                    If txtInput.Text = "0" Then
                        txtInput.Text = btn1.Tag
                    Else
                        txtInput.AppendText(btn9.Tag)
                    End If
                Case 0
                    If txtInput.Text = "0" Then
                        txtInput.Text = btn1.Tag
                    Else
                        txtInput.AppendText(btn0.Tag)
                    End If

            End Select
        End If

      

    End Sub
 
HELP:
Crystal Report in VB 2010

Could not load file or assembly 'file:///C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.

Ano po ibig sabihin nito?
 
tanong ko lang mga master pano ko maiadd ang ganito ka habang numbers

999999999999999999999999999999999999
+
999999999999999999999999999999999999

pano maiadd yan using looping and Array?
 
:help: pano po mag set ng Date! example 1st semester is from 6/4/12 to 8/10/12? at anong tools ang gagamitin, DTPicker or MonthCalendar? :help:
 
Last edited:
:help: pano po mag set ng Date! example 1st semester is from 6/4/12 to 8/10/12? at anong tools ang gagamitin, DTPicker or MonthCalendar? :help:

Usually ginagamit ko DTPicker kung date ang fields ko Sir. Easy to control ba.
 
Good Day po ask ko lang po if paano po ba magsave ng images sa mssql sa project po kasi namin bale sa mssql po naman isasave ung mga resources then ireretrieve po namin un sa vb.net thanks po :))
 
Code:
 Sub fillData()
        sqlQRY = "Select * from BorrowersInfo Where BorrowersID = '" & txtid.Text & "'or Lname like '%" & txtid.Text & "%'"
        cmd = New OleDbCommand(sqlQRY, conn)

        dr = cmd.ExecuteReader
        dr.Read()
        txtid.Text = dr(0)
        txtfname.Text = dr(1)
        txtmname.Text = dr(2)
        txtlname.Text = dr(3)
        txtaddress.Text = dr(4)

        dr.Close()
    End Sub

mga sir ito po code ko para maview ko ang nasearch ko na records..kaso pang isa lng madisplay nya sa textbox..gusto ko sana pag makahanap siya ng dalawa o higit pa na records ai ilalabas nya sa ibang form na may listview at dito niya edidisplay..panu po ang code o "if condition" nito mga sir pahingi po ng hints..tnx..:help::pray:
 
Last edited:
Back
Top Bottom