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!

Pa help po regarding sa System namen deadline napo sa 30 and we need to defend it pa po
Voting System po sya and yung kulang nalang po how to count votes po thanks po

ano database gamit nyo?
 
My Sql po sir

- - - Updated - - -



My Sql po siya sir

post mo dito structure ng tbl_votes mo.

usually its, SELECT count(columnVote) `votes`, candidate FROM tbl_votes GROUP BY candidate;
or if may relation to other tables. its like, SELECT count(a.columnVote) `votes`, b.candidate FROM tbl_votes a INNER JOIN tbl_cadidate b ON a.candidateId = b.candidateId GROUP BY a.candidateId;
 
ano yung structure ng database mo?
how many tables? ano yun respective tables? ano yung data na nakalagay sa tables?
how do you place a vote?

post mo dito structure ng tbl_votes mo.

usually its, SELECT count(columnVote) `votes`, candidate FROM tbl_votes GROUP BY candidate;
or if may relation to other tables. its like, SELECT count(a.columnVote) `votes`, b.candidate FROM tbl_votes a INNER JOIN tbl_cadidate b ON a.candidateId = b.candidateId GROUP BY a.candidateId;

View attachment 208834

Yung Id_No po yun yung Id_no ng student na nag register na nasa ibang table po sya
 

Attachments

  • Untitled.png
    Untitled.png
    69 KB · Views: 28
Help po pano po mag copy ng file sa folder na may kamuka ng filename, examle sa folder photo meron na dong "sample.jpg" ngayon magcocopy ulit ako ng isa pang pic which is "sample.jpg" also pano po sya marerename sa "sample(2).jpg" or any format?
 
View attachment 1018248

Yung Id_No po yun yung Id_no ng student na nag register na nasa ibang table po sya

di ko alam structure ng candidates mo votes lang kasi nilagay mo pero tingnan mo to baka may magets ka na.
Code:
SELECT [COLOR="#FF0000"]Candidate[/COLOR], (SELECT COUNT(*) FROM tblVotes WHERE tblVotes.President = [COLOR="#FF0000"]tblcandidates.ID[/COLOR]) Votes
FROM tblcandidates
Help po pano po mag copy ng file sa folder na may kamuka ng filename, examle sa folder photo meron na dong "sample.jpg" ngayon magcocopy ulit ako ng isa pang pic which is "sample.jpg" also pano po sya marerename sa "sample(2).jpg" or any format?

file.exist para macheck if existing na
file.copy para mag copy paste

so first check if existing pag yes change mo filename na isuply sa file.copy if not then proceed sa original filename.
 
Help po pano po mag copy ng file sa folder na may kamuka ng filename, examle sa folder photo meron na dong "sample.jpg" ngayon magcocopy ulit ako ng isa pang pic which is "sample.jpg" also pano po sya marerename sa "sample(2).jpg" or any format?

textReplace lang to, check if file existing first, if not proceed to copy, if it is use Text Replace command then add sa dulo ng word yungnumber, bali mag cocounter ka dito.
 
Salamat sa replies, ask ko lang sino dotnetbar user dito? lam nyo kung saan may mga tutorial ng commands and controls nito? :)
 
Good day mga sir. Tanong ko lang, ano ang preferred nyo, mag connect sa database using the datasource config wizard, o through codes? Ano yung mas madaling i-maintain?
 
Good day mga sir. Tanong ko lang, ano ang preferred nyo, mag connect sa database using the datasource config wizard, o through codes? Ano yung mas madaling i-maintain?

codes, kasi dynamic, hindi static.
 
mga master ask lang. alam ko pong basic lng to.. need ko lng ng tulong.. hoho eto po yung code..

Dim FILE_NAME As String = "C:\VALUE2.txt"
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write(TextBox2.Text)
objWriter.Close()
MsgBox("Text written to file")
Else
MsgBox("File Does Not Exist")
End If

ngayon po pag mag ttype ako massave sya. mkkita sa directory nya. ang gusto ko naman pong mang yare. next time na mag type ulit ako ibang file name naman ng notepad yung lalabas kase po nag ooverwrite lang sya. gusto ko po sana ddagdag lang ng notepad para masave lahat ng database na gngwa ko. sana may makatulong .. medyo magulo po yung explanation ko pasensya hoho.

sana po may mag reps ako TIA>.
 
mga master ask lang. alam ko pong basic lng to.. need ko lng ng tulong.. hoho eto po yung code..

Dim FILE_NAME As String = "C:\VALUE2.txt"
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write(TextBox2.Text)
objWriter.Close()
MsgBox("Text written to file")
Else
MsgBox("File Does Not Exist")
End If

ngayon po pag mag ttype ako massave sya. mkkita sa directory nya. ang gusto ko naman pong mang yare. next time na mag type ulit ako ibang file name naman ng notepad yung lalabas kase po nag ooverwrite lang sya. gusto ko po sana ddagdag lang ng notepad para masave lahat ng database na gngwa ko. sana may makatulong .. medyo magulo po yung explanation ko pasensya hoho.

sana po may mag reps ako TIA>.

Dim FILE_NAME As String = "C:\VALUE2.txt" ---> Dim FILE_NAME As String = string.format("c:\{0}.txt", textboxsomewhere.text)

add ka ng textbox textboxsomewhere at dun mo ilagay ang filename, if you want more flexible code, gamit ka ng openfile dialog
 
Dim FILE_NAME As String = "C:\VALUE2.txt" ---> Dim FILE_NAME As String = string.format("c:\{0}.txt", textboxsomewhere.text)

add ka ng textbox textboxsomewhere at dun mo ilagay ang filename, if you want more flexible code, gamit ka ng openfile dialog

pwede po kaya na lagyan ng folder yan. para mas malinis haha. trinay ko kase ayaw eh. pero okay to boss laking tulong salamat.!
 
pwede po kaya na lagyan ng folder yan. para mas malinis haha. trinay ko kase ayaw eh. pero okay to boss laking tulong salamat.!

Code:
Dim FILE_NAME As String = string.format("c:\FOLDER\{0}.txt", textboxsomewhere.text

mas maganda kung mag savefiledialog ka nlng gaya ng sinabi ni master maskio
 
mga bossing bat hndi ko sya mgwa dito
Dim objWriter As New System.IO.StreamWriter("D:\INFO.txt", False)
objWriter.WriteLine("NAME:")
objWriter.WriteLine(TextBox1.Text)
objWriter.WriteLine("")

objWriter.WriteLine("PREFERRED COURSE:")
objWriter.WriteLine(TextBox2.Text)
objWriter.WriteLine("")

objWriter.WriteLine("SECTION:")
objWriter.WriteLine(TextBox8.Text)
objWriter.WriteLine("")

objWriter.WriteLine("HOME ADDRESS:")
objWriter.WriteLine(TextBox6.Text)
objWriter.WriteLine("")

objWriter.WriteLine("MOBILE/TELNO:")
objWriter.WriteLine(TextBox5.Text)
objWriter.WriteLine(" ")

objWriter.WriteLine("Parent / GUARDIAN:")
objWriter.WriteLine(TextBox3.Text)
objWriter.WriteLine("")

objWriter.WriteLine("MOBILE/TELNO:")
objWriter.WriteLine(TextBox5.Text)
objWriter.WriteLine("")

objWriter.WriteLine("OCCUPATION:")
objWriter.WriteLine(TextBox4.Text)
objWriter.WriteLine("")


ayaw po neto Dim FILE_NAME As String = string.format("c:\{0}.txt", textboxsomewhere.text)
 
mga bossing bat hndi ko sya mgwa dito
Dim objWriter As New System.IO.StreamWriter("D:\INFO.txt", False)
objWriter.WriteLine("NAME:")
objWriter.WriteLine(TextBox1.Text)
objWriter.WriteLine("")

objWriter.WriteLine("PREFERRED COURSE:")
objWriter.WriteLine(TextBox2.Text)
objWriter.WriteLine("")

objWriter.WriteLine("SECTION:")
objWriter.WriteLine(TextBox8.Text)
objWriter.WriteLine("")

objWriter.WriteLine("HOME ADDRESS:")
objWriter.WriteLine(TextBox6.Text)
objWriter.WriteLine("")

objWriter.WriteLine("MOBILE/TELNO:")
objWriter.WriteLine(TextBox5.Text)
objWriter.WriteLine(" ")

objWriter.WriteLine("Parent / GUARDIAN:")
objWriter.WriteLine(TextBox3.Text)
objWriter.WriteLine("")

objWriter.WriteLine("MOBILE/TELNO:")
objWriter.WriteLine(TextBox5.Text)
objWriter.WriteLine("")

objWriter.WriteLine("OCCUPATION:")
objWriter.WriteLine(TextBox4.Text)
objWriter.WriteLine("")


ayaw po neto Dim FILE_NAME As String = string.format("c:\{0}.txt", textboxsomewhere.text)

here you go:
ikaw na bahala mag modify to your needs

Code:
Imports System.IO

Public Class Form4
    Private Sub btnBrowse_Click(sender As Object, e As EventArgs) Handles btnBrowse.Click
        Using CreateFile As New SaveFileDialog()
            With CreateFile
                .Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
                .RestoreDirectory = True
                .OverwritePrompt = False

                If .ShowDialog() = Windows.Forms.DialogResult.OK Then
                    ' pag nag click ng OK
                    txtLocation.Text = CreateFile.FileName

                    If My.Computer.FileSystem.FileExists(CreateFile.FileName) Then
                        Using sr As StreamWriter = File.AppendText(CreateFile.FileName)
                            With sr
                                .WriteLine(String.Format("NAME: {0}", "Oiksam")) ' next record using the same text file
                                .WriteLine(String.Format("PREFERRED COURSE: {0}", "ComSci"))
                                .WriteLine(String.Format("SECTION: {0}", "88"))
                                .WriteLine(String.Format("HOME Address: {0}", "Pluto"))
                                .WriteLine(String.Format("so on and so forth: {0}", "(-_-)"))
                            End With
                        End Using ' sr.close 
                    Else
                        Using sr As StreamWriter = File.CreateText(CreateFile.FileName)
                            With sr
                                .WriteLine(String.Format("NAME: {0}", "Maskio")) ' this should be like .WriteLine(String.Format("NAME: {0}", txtName.text)) im lazy to add more controls
                                .WriteLine(String.Format("PREFERRED COURSE: {0}", "Information Technology"))
                                .WriteLine(String.Format("SECTION: {0}", "99"))
                                .WriteLine(String.Format("HOME Address: {0}", "Earth"))
                                .WriteLine(String.Format("so on and so forth: {0}", "(^_^)"))
                            End With
                        End Using ' sr.close 
                    End If
                End If
            End With
        End Using
    End Sub
End Class

and the ss (see attachment)
 

Attachments

  • 1.png
    1.png
    23.3 KB · Views: 11
  • 2.png
    2.png
    2 KB · Views: 11
  • 3.png
    3.png
    10.7 KB · Views: 13
Hi po ask ko lang po kung pano mag differentiate ng time, meron kasi akong event time start time at end time. so sa screen lalabas yung name ng event sa time nya onwards hanggang matapos yung time span nya, then mag cchange sya once na tapos na yung time nya at lalabas naman yung susunod na event sa screen.
 
malabo ang tanong mo,
i think ang ibig mo sabihin ay vb.net at vb6

Visual Studio is the IDE
like MSOFFICE na meron MSWORD at EXCEL

VB.NET is the language

http://en.wikipedia.org/wiki/Microsoft_Visual_Studio

eto yung versions



WIN32
Visual Studio 97 (VB5, C++, etc)
Visual Studio 6.0 (1998) (VB6, C++, VFP)
NOT SUPPORTED BY Microsoft anymore




http://upload.wikimedia.org/wikipedia/en/6/6a/Visual_studio_logo.png

.NET FRAMEWORK
Visual Studio .NET (2002) (VB.NET 2002, C#, etc)
Visual Studio .NET 2003 (VB.NET 2003, C#, etc)
Visual Studio 2005 (VB 2005, C#, etc)
Visual Studio 2008 (VB 2008, C#, etc)
Visual Studio 2010 (VB 2010, C#, etc)


VB6 is a WIN32 development tool
meaning ginagamit to create applications in the Windows32bit platform using native windows library.

VB.NET (VB2005 - VB2010) is a development tool to create applications running under the .NET Framework


sana malinaw yan so that we know na IISA lang ang tinutukoy nating bagay.

W0W great explanation sir.
Thank you for sharing your knowledge with us.
=)
 
Hi po ask ko lang po kung pano mag differentiate ng time, meron kasi akong event time start time at end time. so sa screen lalabas yung name ng event sa time nya onwards hanggang matapos yung time span nya, then mag cchange sya once na tapos na yung time nya at lalabas naman yung susunod na event sa screen.

I'm not sure kung tama yung pagkakaintindi mo sa tanong mo.

te declare a variable as date/time

Code:
        Dim dateVariable As Date = "4/7/15 3:00 PM"

to get the current time in vb.net we use

Code:
Now

to compare the the 2 and toggle a picturebox
Code:
if DateDiff(DateInterval.Minute,dateVariable,Now) = 0 then
picturebox1.visible = true
end if

use a timer to do this every second and put whatever you want to do.
 
Back
Top Bottom