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!

Good day mga ka SB:
Help po sa problem ko about registration form. Paano ko po magagawa na kapag na read na may username na sa database ko (MS Access 2013) eh mag mesagebox.show("Username is not valid). Ganto po kac ginawa ko:

Dim conn As New System.Data.OleDb.OleDbConnection()
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\ECE QUIZ DATABASE.accdb;Jet OLEDB:Database Password=password123"

Try
Dim sql As String = "SELECT * FROM Account WHERE Username= '" & txtUsername.Text & "'"
'Dim sql As String = "SELECT * FROM Account WHERE LastName= '" & txtLN.Text & "' AND FirstName= '" & txtFN.Text & "' AND MiddleName= '" & txtMN.Text & "'" & _
' "AND Address= '" & txtPMA.Text & "' AND ContactNumber= '" & txtCN.Text & "' AND "

Dim sqlCom As New System.Data.OleDb.OleDbCommand(sql)

'Open Database Connection
sqlCom.Connection = conn
conn.Open()

Dim sqlRead As System.Data.OleDb.OleDbDataReader = sqlCom.ExecuteReader()

If sqlRead.Read() Then
MessageBox.Show(" -Username is not valid. Please change your username", "The following errors were encountered:", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
End If

Catch ex As Exception
MessageBox.Show("Failed to connect to Database.. System Error Message: " & ex.Message, "Database Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try

Nagawa ko na madedetect nya na meron nang username sa database. Ang problema ko na lang eh kapag walang katulad sa DB eh aadd nya un sa DB.
Hope may mag bigay ng example hehehhe
 
Good day mga ka SB:
Help po sa problem ko about registration form. Paano ko po magagawa na kapag na read na may username na sa database ko (MS Access 2013) eh mag mesagebox.show("Username is not valid). Ganto po kac ginawa ko:

Dim conn As New System.Data.OleDb.OleDbConnection()
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\ECE QUIZ DATABASE.accdb;Jet OLEDB:Database Password=password123"

Try
Dim sql As String = "SELECT * FROM Account WHERE Username= '" & txtUsername.Text & "'"
'Dim sql As String = "SELECT * FROM Account WHERE LastName= '" & txtLN.Text & "' AND FirstName= '" & txtFN.Text & "' AND MiddleName= '" & txtMN.Text & "'" & _
' "AND Address= '" & txtPMA.Text & "' AND ContactNumber= '" & txtCN.Text & "' AND "

Dim sqlCom As New System.Data.OleDb.OleDbCommand(sql)

'Open Database Connection
sqlCom.Connection = conn
conn.Open()

Dim sqlRead As System.Data.OleDb.OleDbDataReader = sqlCom.ExecuteReader()

If sqlRead.Read() Then
MessageBox.Show(" -Username is not valid. Please change your username", "The following errors were encountered:", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
End If

Catch ex As Exception
MessageBox.Show("Failed to connect to Database.. System Error Message: " & ex.Message, "Database Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try

Nagawa ko na madedetect nya na meron nang username sa database. Ang problema ko na lang eh kapag walang katulad sa DB eh aadd nya un sa DB.
Hope may mag bigay ng example hehehhe

kung inaral mo ang ADO.NET malalaman mo na TRUE yung sqlRead.Read() pag may nabasang record
so alam mo na dapat gagawin pag nag FALSE yan
 
Sir eric, tanong ko lang po in terms sa database,

Which is better allow's null or not?
 
In this activity, you will create a stand-alone version of the NBI Online Application.

Check this link for the online application:
http://nbi.njis-ph.com/

View this image for a sample output of the application:
http://goo.gl/qKnmTv

Changes in objects used in the form is allowed e.g. you can use a radio buttons for gender instead of a combo box.

.
-mga master patulong naman po,baka may application po kayo na katulad nito,or kahit tips lang po.salamat po.
 
In this activity, you will create a stand-alone version of the NBI Online Application.

Check this link for the online application:
http://nbi.njis-ph.com/

View this image for a sample output of the application:
http://goo.gl/qKnmTv

Changes in objects used in the form is allowed e.g. you can use a radio buttons for gender instead of a combo box.

.
-mga master patulong naman po,baka may application po kayo na katulad nito,or kahit tips lang po.salamat po.


so ano ang problem?
wala pang tips sa ngayon dahil wala ka pa naman naumpisahan
umpisahan mo na yung tables at GUI muna on your own, using your own talent

- - - Updated - - -

Sir eric, tanong ko lang po in terms sa database,

Which is better allow's null or not?

pareho naman BETTER yan e

sa akin kasi meron parating default para di ko na i check kung null o hinde
sa isang banda may advantage din yung allow null kung di mo kabisado ang table at mag insert ka

balansehin mo lang yan, pag marami ka na nagwa na systems masasanay ka rin sa style na gusto mo
 
sir, help po. Bakit di ko na maaccess yung variable sa kabilang form using "[formname].[variable].text" format? kahit aalamin lang kung enable/disable yung combo box etc. Thanks.
 
sir, help po. Bakit di ko na maaccess yung variable sa kabilang form using "[formname].[variable].text" format? kahit aalamin lang kung enable/disable yung combo box etc. Thanks.

di naman kasi dapat ganyan e
mag create ka ng properties sa form at yun ang i access mo
yan ang OOP way
 
sir, question pwede ka bang magdeclare ng if then statement para macontrol ang dtabase? meron po ako 2 tables sa ms access tblStud at tblReg. empty po ang tblReg ko. ang balak ko po ay since empty ang tblReg ko kkunin ko sa tblStud ung max Id then add 1 ko pra mailagay ko sa Reg Form ko sa vb. bale gumamit po ako ng sub sa loob ng reg form ko. eto po ung code

Sub caller()
con.ConnectionString = constring
con.Open()
cmd = New OleDbCommand("SELECT max(Stud_id) FROM tblReg", con)
dr = cmd.ExecuteReader
If dr.HasRows Then
cmd = New OleDbCommand("SELECT max(Student_ID) FROM tblStud", con)
dr = cmd.ExecuteReader

With dr
.Read()
txthide.Text = .GetValue(0)
txtStudno.Text = txthide.Text + 1
End With

ElseIf Not dr.HasRows Then
cmd = New OleDbCommand("SELECT max(Stud_id) FROM tblReg", con)
dr = cmd.ExecuteReader
With dr
.Read()
txthide.Text = .GetValue(0)
txtStudno.Text = txthide.Text + 1
End With
End If
con.Close()
End Sub
 
Last edited:
di naman kasi dapat ganyan e
mag create ka ng properties sa form at yun ang i access mo
yan ang OOP way

gusto ko lang malaman sir kung ano yung possible reason bakit di na gumagana? kasi nung una una pa, gumagana naman.
 
sir eric ask lang po ng help

visual basic codes

ang problem ko kc eh ganito:

meron akong 2 table

per table merong 4 fields

like this:

table_1
<van_number> | <status> | <date> | location>

table_2
<van_number> | <status> | <date> | location>


ngayon ganito meron clang mga records...


table_1
<van_number> | <status> | <date> | location>
101 | out | 2011-06-20 | Manila
102 | in | 2011-06-10 | Davao
103 | transfer | 2011-06-12 | GenSan
104 | pickup | 2011-06-06 | Manila

table_2
<van_number> | <status> | <date> | location>
101 | fulls | 2011-06-25 | Cagayan
102 | empty | 2011-06-01 | Manila
103 | repair | 2011-06-15 | Davao
104 | transfer | 2011-06-09 | Manila

ngayon mag co-COPARE yung dalawang table mag jo-JOIN at mag fi-FILTER...

dapat lahat ng may status na 'empty' at 'out' ay di mag mag ddisplay sa records

then dapat lahat ng may location na 'manila' lang ang mag sshow ang records

then dapat yung may latest or updated na date ang mag show na records

yan po sir... sana matulungan nyo ako

TIA


Idol..you need to study on query more.. STUDY JOIN, LEFT J, RIGHT J, ON, BETWEEN, WHERE at so many more....
 
Mga Sir pasensya na sa noob question ko, ano pong idadagdag sa connection string pag may password ang access database? Maraming Salamat
 
salamat po mga sir
salamat sir eric

nakalusot ako sa thesis defense sir
salamat sa tulong. :)
 
Sir, ano po ba mas ideal sa pagaadd ng product with multiple supplier? isa isang gagawan ng record o pwedeng sa isang new product pwede na yung maraming supplier ang ilalagay? Thanks.
 
try mo yung mga links na nasa first post, basic yung mga yun.
pwede natin pagtulungan kung anon topic ang ituturo mo at kung ano ang laman,
para naman di mahuli yung mga students mo
madami ako pde i share ng coding techniques para sa kanila




gusto ko kcng mangyari dyn yong negative dapat mapupunta sa change tulad ng nsa pic kc pag nagcocompute aq lagi syang nsa balance ...d namn pwede yon kc dpat 0.00 balance na sya at dapt don mapupunta yong sagot sa change..

Edit / Delete Edit Post Multi-Quote This Message Add To Quote Reply With Quote Reply With Quote Report Post

25fndc6.jpg


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Double = txtname.Text
i -= txtpayment.Text
txtbalance.Text = i.ToString
End Sub
 
Sir, ano po ba mas ideal sa pagaadd ng product with multiple supplier? isa isang gagawan ng record o pwedeng sa isang new product pwede na yung maraming supplier ang ilalagay? Thanks.

pareho naman na ok yan, depende sa settings ng business

kung 1rec per supplier, treated as unique ang prod/supplier
applicable kung middleman ka, marami kang supplier for example ng bigas
at iba iba ang presyo bawat supplier
so maganda na naka indicate kung kanino yung bigas na binibenta mo

kung 1 rec to many supplier meron kang table para i link ang many supplier sa 1 rec.
ok to kung retailer ka at standard ang pricing

remember sa design/analysis walang mali,
kung ano yung gumagana ng maayos ayon sa users yun ang tama

kung naging maayos ang business dahil sa system mo then tama ang design mo
kung lalo nahirapan ang user o nalugi ang business dahil sa system mo then yun ang palpak
 
pareho naman na ok yan, depende sa settings ng business

kung 1rec per supplier, treated as unique ang prod/supplier
applicable kung middleman ka, marami kang supplier for example ng bigas
at iba iba ang presyo bawat supplier
so maganda na naka indicate kung kanino yung bigas na binibenta mo

kung 1 rec to many supplier meron kang table para i link ang many supplier sa 1 rec.
ok to kung retailer ka at standard ang pricing

remember sa design/analysis walang mali,
kung ano yung gumagana ng maayos ayon sa users yun ang tama

kung naging maayos ang business dahil sa system mo then tama ang design mo
kung lalo nahirapan ang user o nalugi ang business dahil sa system mo then yun ang palpak

sayang walang LIKE button dito. hahaha. salamat sir. gets ko na. :) pahirap talaga mga panel sa thesis, pinipilit yung 1 to many. thanks.
 
sayang walang LIKE button dito. hahaha. salamat sir. gets ko na. :) pahirap talaga mga panel sa thesis, pinipilit yung 1 to many. thanks.

isipin mo yung panel ay client mo, dapat ma satisfy mo ang requirements nila para maka singil ka
kung di sila kuntento sa pinagawang system magbabayad ba sila?
 
Back
Top Bottom