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!

Baka may links kau for Expressions??


Need ko lng ng validation for money and other inputs..

Thanks..

Im using Asp.net
 
- pa help po, ito po yung code ko, need q po yung code na ma delete po lahat ng record sa database as 1 click sana. meron jan button. thnx in advance po -



Private Sub Add_Click()
Frame1.Visible = True
txtint.Text = ""
txtid.Text = ""
txttotalbet.Text = ""
txttotal.Text = ""
txtnegative.Text = ""
Frame2.Visible = False
txtnum.SetFocus
Dim rss As Recordset
Set rss = New Recordset
Dim cnn As Connection
Set cnn = New Connection
cnn.CursorLocation = adUseClient
cnn.Open GetConnectionString

rss.Open "Select * from tbltest", cnn, adOpenDynamic, adLockBatchOptimistic
Set DataGrid1.DataSource = rss

End Sub

Private Sub cmdclick2_Click()
If txttotalbet.Text = "" And txtnegative.Text = "" Then
MsgBox "Invalid Input", vbExclamation, "Error"
Else
txttotal.Text = Val(txttotalbet.Text) - Val(txtnegative.Text)
End If
End Sub

Private Sub cmdok_Click()
Dim rs As Recordset
Dim cnn As Connection
Set cnn = New Connection
cnn.CursorLocation = adUseClient
cnn.Open GetConnectionString
Dim prev As Currency
Dim total As Currency
Dim itotal As Currency
Dim t1 As Currency
Dim t2 As Currency
Dim t3 As Currency

If txtnum.Text = "" Then
MsgBox "Invalid Input", vbExclamation, ""
txtnum.SetFocus
ElseIf Len(txtnum.Text) < 3 Then
MsgBox "Invalid Input", vbExclamation, ""
txtnum.SetFocus
ElseIf Val(txtnum.MaxLength) <= 2 Then
MsgBox "Invalid Input", vbExclamation, ""
txtnum.SetFocus
ElseIf txtbet.Text = "" Then
MsgBox "Invalid Input", vbExclamation, ""
txtbet.SetFocus
ElseIf txtbet.Text <= 0 Then
MsgBox "Invalid Input", vbExclamation, ""
txtbet.SetFocus
ElseIf txtlimit.Text = "" Then
MsgBox "Invalid Input", vbExclamation, ""
txtlimit.SetFocus
ElseIf txtlimit.Text <= 0 Then
MsgBox "Invalid Input", vbExclamation, ""
txtlimit.SetFocus
Else
Set rs = New Recordset
rs.Open "select * from tbltest where ID_Num='" & frmmain.txtnum.Text & "'", cnn, adOpenDynamic, adLockBatchOptimistic
If rs.EOF Then
rs.AddNew
rs.Fields("ID_Num") = txtnum.Text
rs.Fields("Bet") = txtbet.Text
rs.Fields("Limit") = txtlimit.Text
rs.Fields("iTotal") = Val(txtbet.Text) - Val(txtlimit.Text)
rs.Update
rs.UpdateBatch


Else
itotal = rs.Fields("Bet")
t1 = rs.Fields("Limit")
t2 = rs.Fields("iTotal")

total = txtbet.Text

total = itotal + total
rs.Fields("Bet") = total
t3 = total - t1
rs.Fields("iTotal") = t3




rs.Update
rs.UpdateBatch

End If
End If


Dim rss As Recordset
Set rss = New Recordset
rss.Open "Select * from tbltest", cnn, adOpenDynamic, adLockBatchOptimistic
Set DataGrid1.DataSource = rss
txtnum.Text = ""
txtbet.Text = ""
txtnum.SetFocus
End Sub

Private Sub Command1_Click()
On Error GoTo Procerror
Dim cnn As Connection
Set cnn = New Connection
cnn.CursorLocation = adUseClient
cnn.Open GetConnectionString
Dim rs As Recordset
Set rs = New Recordset

rs.Open "Select sum(iTotal)as bettotal from tbltest", cnn, adOpenDynamic, adLockBatchOptimistic
txtztotal.Text = rs!bettotal



Procexit:
Exit Sub

Procerror:
MsgBox "No Records Found", vbExclamation, "Empty Fields"
txtztotal.Text = ""
Resume Procexit



End Sub





Private Sub Command2_Click()
' ito sana yung button (1 click delete all )para ma delete lahat ng records sa database.

End Sub


Private Sub DataGrid1_DblClick()
On Error GoTo Procerror

Dim cnn As Connection
Set cnn = New Connection
cnn.CursorLocation = adUseClient
cnn.Open GetConnectionString
Dim rs As Recordset
Set rs = New Recordset

rs.Open "Delete * from tbltest where ID_Num= '" & DataGrid1.Columns(0) & "'", cnn, adOpenDynamic, adLockBatchOptimistic

Set rs = New Recordset
rs.Open "Select * from tbltest", cnn, adOpenDynamic, adLockBatchOptimistic
DataGrid1.ClearFields
DataGrid1.Refresh
Set DataGrid1.DataSource = rs

Procexit:
Exit Sub

Procerror:
MsgBox "Empty Field", vbExclamation, ""
Resume Procexit




End Sub

Private Sub Form_Activate()
Dim rss As Recordset
Dim rs As Recordset
Set rs = New Recordset
Set rss = New Recordset
Dim cnn As Connection
Set cnn = New Connection
cnn.CursorLocation = adUseClient
cnn.Open GetConnectionString

rss.Open "Select * from tbltest", cnn, adOpenDynamic, adLockBatchOptimistic
Set DataGrid1.DataSource = rss



End Sub



Private Sub Subtract_Click()

Frame2.Visible = True
txtnum.Text = ""
txtbet.Text = ""
Frame1.Visible = False
txtint.SetFocus
End Sub



Private Sub sub_Click()

Frame2.Visible = True
txtnum.Text = ""
txtbet.Text = ""
Frame1.Visible = False
txtint.SetFocus

End Sub

Private Sub txtbet_KeyPress(KeyAscii As Integer)
Dim strvalid
strvalid = "1234567890"
If KeyAscii > 26 Then
If InStr(strvalid, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
If KeyAscii = vbKeyReturn Then
cmdok.SetFocus
End If


End Sub


Private Sub txtint_KeyPress(KeyAscii As Integer)

Dim cnn As Connection
Set cnn = New Connection
cnn.CursorLocation = adUseClient
cnn.Open GetConnectionString

Dim rss As Recordset

Dim strvalid
strvalid = "1234567890"
If KeyAscii > 26 Then
If InStr(strvalid, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If

If KeyAscii = vbKeyReturn Then
If Len(txtint.Text) < 3 Then
MsgBox "Invalid Input", vbExclamation, "Error"
txtint.SetFocus



Else
On Error GoTo Procerror
Set rss = New Recordset

rss.Open "Select Bet from tbltest where ID_Num='" & txtint.Text & "'", cnn, adOpenDynamic, adLockBatchOptimistic
txttotalbet.Text = rss!Bet
txtid.Text = txtint.Text
txtint.Text = ""
txtnegative.SetFocus

Procexit:
Exit Sub
Procerror:
MsgBox "Empty Field", vbExclamation, ""
Resume Procexit

End If
End If

End Sub



Private Sub txtlimit_KeyPress(KeyAscii As Integer)
Dim strvalid
strvalid = "1234567890"
If KeyAscii > 26 Then
If InStr(strvalid, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
If KeyAscii = vbKeyReturn Then
cmdok.SetFocus
End If

End Sub

Private Sub txtnegative_KeyPress(KeyAscii As Integer)
Dim strvalid
strvalid = "1234567890"
If KeyAscii > 26 Then
If InStr(strvalid, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
If KeyAscii = vbKeyReturn Then
If txtnegative.Text = "" Then
MsgBox "Invalid Input", vbExclamation, "Error"
txtnegative.SetFocus
ElseIf txtnegative.Text <= 0 Then
MsgBox "Invalid Input", vbExclamation, "Error"
txtnegative.SetFocus
Else

cmdclick2.SetFocus
End If
End If

End Sub

Private Sub txtnum_KeyPress(KeyAscii As Integer)
Dim strvalid
strvalid = "1234567890"
If KeyAscii > 26 Then
If InStr(strvalid, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
If KeyAscii = vbKeyReturn Then
txtbet.SetFocus
End If

End Sub
 
Last edited:
di ata yan gagana..
eto ang option na pwede

DELETE FROM YourTable WHERE somecolumn =

or

DELETE YourTable WHERE somecolumn =


:)

I believe marunong kang magbasa.
I-quote ko lang...

- pa help po, ito po yung code ko, need q po yung code na ma delete po lahat ng record sa database as 1 click sana. meron jan button. thnx in advance po -

Private Sub Command2_Click()
' ito sana yung button (1 click delete all )para ma delete lahat ng records sa database.

End Sub

Code daw lahat para ma-delete ng record sa database.
Dalawang beses niya sinabi, lahat daw ng records ay burahin.

Tsaka itong code mo, sure ka ba na tama to?

DELETE YourTable WHERE somecolumn =
 
this is the syntax for mySQL delete;

DELETE FROM yourtable;
## note that the auto increment ID will not reset

or

TRUNCATE yourtable;
## this will reset auto increment ID
 
I believe marunong kang magbasa.
I-quote ko lang...





Code daw lahat para ma-delete ng record sa database.
Dalawang beses niya sinabi, lahat daw ng records ay burahin.

Tsaka itong code mo, sure ka ba na tama to?


anu po talga tama boss??
 
question po.

pag ba gumagawa ng business system, lahat ng child form naka showintaskbar = false?

Thanks.
 
Hello mga programmers. I need help lang. Ano po yung code para sa student subject program using 2 listviews? May input din po siya about info sa student atsaka sa subjects nya. Thanks.
 
Hello Mga Sir,

Desire kong matuto ng programming, gumawa ng applications, software, anu po dapat ang una kong gagawin?
 
Ser patulong naman po kung panu makakagawa ng simple exam using vb.net....
with result...kahit isang tanung lang...basta example concept lang...:help:
 
boss panu pu icode kapag ang height of the listbox must start small and increase according to the number of iterations.
 
Pwede po bang makahingi ng GUi for P.O receiving??

Depende po kasi sa items kung serializable or endi ..

Thnx .. sample lng :)
 
I have this sample code below,

Pano gawing loop yan? Yung di na ako magcopy paste :D

Pang demo lang sana ;)

Code:
  With ListView1.Items.Add("Product001")
            .SubItems.Add("Computer Desktop")
            .SubItems.Add("10")
            .SubItems.Add("64 bit / W8")
            .SubItems.Add("Accounting")
        End With

1CgxSj7.png
 
Last edited:
Mga master, bigla nalang nag ka crash yung ginawa kong application. Kapag sa debugging naman hindi ko ma trace. Eto po yung log mismo sa event logs :

1. Faulting application name: UPI Utility.exe, version: 1.0.0.8, time stamp: 0x53ec1c8b
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b83c8a
Exception code: 0xe06d7363
Fault offset: 0x0000c41f
Faulting process id: 0x1110
Faulting application start time: 0x01cfc0f85367ba93
Faulting application path: C:\Program Files (x86)\My Product Name\UPI Utility.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: 258f9de3-2cec-11e4-a2ac-00505680348d

2. Application: UPI Utility.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: exception code e06d7363, exception address 75FFC41F

Sana me makatulong po. VB.NET ko ginawa yung application.
 
Sino na nakakita ng Medical Dental System dito ? Meron ba pwede matanungan palagi ?
Pa pm po. :D
 
Back
Top Bottom