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!
sir patulong po ule... meron na akong code na naididisplay ang sequence number galing sa database na nag a-auto increment na... nag-umpisa aq sa number 0001 then mag iincrement na xia ng 1.... kaso pagdinisplay ko na xa sa textlabel ang nagpapakita lang ay 2(two)... eh gusto ko sana ang display ay ganito 0002... pano po ba un?? eto code q
Dim cn As New MySqlConnection(CnPath)
Dim Sql As String = "Select max(sequence) From tblsequence"
Dim Cmd As New MySqlCommand(Sql, cn)
cn.Open()
Dim datinfo As MySqlDataReader = Cmd.ExecuteReader()
While datinfo.Read()
If IsDBNull(datinfo(0)) = True Then
seq.Text = (Val(Description.Text)) + Val(1)
Else
labelsequence.Text = datinfo(0) + 1
End If
End While
cn.Close()
patulong po ule... ayaw gumana sa combobox ung try catch na numeric lang ang iiinput... Sa textbox gumagana... eto po code q...
Dim num As Integer
Try
num = System.Convert.ToDouble(ComboBox1.Text())
Catch ex As Exception
If ComboBox1.Text() = "" Then
Else
MessageBox.Show("Error: Please enter a number", "Error in Input", MessageBoxButtons.OK, MessageBoxIcon.Error)
ComboBox1.Text = ""
ComboBox1.Focus()
End If
End Try
if isnumeric(combobox1.text) = false
MessageBox.Show("Error: Please enter a number", "Error in Input", MessageBoxButtons.OK, MessageBoxIcon.Error)
ComboBox1.Text = ""
ComboBox1.Focus()
end if
If LenTrimTrue(txtUser.Text) = True Then
msgFillField("Username")
Exit Sub
ElseIf LenTrimTrue(txtPass.Text) = True Then
msgFillField("Password")
Exit Sub
End If
Dim conn As New SqlConnection(gConString)
conn.Open()
Dim comm As New SqlCommand()
comm.CommandText = "SELECT * FROM USERS WHERE USERN = '" & txtUser.Text & "' AND PASSW = '" & txtPass.Text & "'"
comm.Connection = conn
Dim readerLogin As SqlDataReader
readerLogin = comm.ExecuteReader
While readerLogin.Read
If readerLogin.Item("UserN") = txtUser.Text And readerLogin.Item("PassW") = txtPass.Text Then
Me.Hide()
mdiForm1.Show()
gAcctName = readerLogin.Item("AcctName")
msgLoginSuc()
[B]Else
MessageBox.Show("Invalid Account", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)[/B]
End If
End While
readerLogin.Close()
conn.Close()
End Sub
mga ka symb pa help naman... nagseself study lang po ako ng vb.net... question lang, bakita ayaw mag trigger ng code na to?
Code:If LenTrimTrue(txtUser.Text) = True Then msgFillField("Username") Exit Sub ElseIf LenTrimTrue(txtPass.Text) = True Then msgFillField("Password") Exit Sub End If Dim conn As New SqlConnection(gConString) conn.Open() Dim comm As New SqlCommand() comm.CommandText = "SELECT * FROM USERS WHERE USERN = '" & txtUser.Text & "' AND PASSW = '" & txtPass.Text & "'" comm.Connection = conn Dim readerLogin As SqlDataReader readerLogin = comm.ExecuteReader While readerLogin.Read If readerLogin.Item("UserN") = txtUser.Text And readerLogin.Item("PassW") = txtPass.Text Then Me.Hide() mdiForm1.Show() gAcctName = readerLogin.Item("AcctName") msgLoginSuc() [B]Else MessageBox.Show("Invalid Account", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)[/B] End If End While readerLogin.Close() conn.Close() End Sub
basically simple login palang yan. lahat naman ng nasa code gumagana pero ung nakabold na messagebox hindi... ano kaya prob?
Mediafire.com mo nlng yan.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim enNum As Integer
Dim sNum As Integer
Dim Answer As Integer
sNum = startNum.Text
enNum = EndNum.Text
For sNum = sNum To enNum
Answer = Answer + sNum
Next
MsgBox(Answer)
End Sub
Exercise
Amend your code to check that the user has entered numbers in the textboxes. You will need an If statement to do this. If there's nothing in the textboxes, you can halt the programme with this code
Exit Sub
For this exercise, you will be passing whatever is in the textboxes to integer variables. It is these variables you are checking with your If Statement. Because numbers will be entered into the textboxes, remember to convert the text to a value with Val( ).
But the Text property will return a zero if the box is empty. So your If statement will need to check the variables for a value of zero. If it finds a zero, Then you can use the Exit Sub code. The If statement should come first, before the For Loop code.
Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim enNum As Integer Dim sNum As Integer Dim Answer As Integer sNum = startNum.Text enNum = EndNum.Text For sNum = sNum To enNum Answer = Answer + sNum Next MsgBox(Answer) End Sub
Gusto ko po sana gawin na mag karon ng MessageBox kapag
Walang laman ung 1st and/or 2nd textbox...
D ko po kasi magawa sa end if
Lagi sya mag bug...
Padagdag nalang po ng Code...
Eto ung exercise na gusto ko sagutan..
Sinubukan ko na ung mga pedeng code pero bug parin..
Kaya nahingi na ko ng tulong...
For this exercise, you will be passing whatever is in the textboxes to integer variables. It is these variables you are checking with your If Statement. Because numbers will be entered into the textboxes, remember to convert the text to a value with Val( ).
snum = val(startnum.text)
If it finds a zero, Then you can use the Exit Sub code. .
The If statement should come first, before the For Loop code.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim enNum As Integer
Dim sNum As Integer
Dim Answer As Integer
' dito mo ilagay ang if statement
'ang syntax ng if statement ganto
' if <condtion is true> then
' dito mo ilagay ang msgbox at exit sub
' dapat mauna ang msgbox ha bago ang exit sub
'end if
sNum = startNum.Text
enNum = EndNum.Text
For sNum = sNum To enNum
Answer = Answer + sNum
Next
MsgBox(Answer)
End Sub