Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,160,446 members, 7,843,367 topics. Date: Wednesday, 29 May 2024 at 12:16 AM

Post Ur Vb.net Questions Here - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Post Ur Vb.net Questions Here (3617 Views)

Post Your Ocpjp (scjp) Questions Here / Please Post All Your Java Programing Questions Here. / Post Ur Vb 6.0 Questions Here (2) (3) (4)

(1) (2) (Reply) (Go Down)

Re: Post Ur Vb.net Questions Here by luckyCO(m): 2:46pm On May 11, 2009
I will write the code and send it to you.
We might need to hv a windows service to make it more professional otheriwse we make it as application which you can goto to starpup and delete.
Re: Post Ur Vb.net Questions Here by fatezy(m): 4:40pm On May 12, 2009
@lucky, thanks in anticipation, i think I would like both, but the professional 1 more, thanks in antic ipation
Re: Post Ur Vb.net Questions Here by fatezy(m): 4:49pm On May 12, 2009
@lucky, thanks in anticipation, i think I would like both, but the professional 1 more, thanks in anticipation
Re: Post Ur Vb.net Questions Here by luckyCO(m): 7:14pm On May 14, 2009
fatezy:

@lucky, Its been long hope u aight! I need a lil help and hope u can b of assistance,
I would like a form to load immediately at system startup, Its to provide a custom login, The problems I have are -
1. Code to make the form load immediate u put on d system
2. To prevent closure of d form using alt + f4.
Thanks 4 your help.

To disable Alt+F4 from closing your form.

Public Class Form1
Dim closedForm As Boolean = False

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
e.Cancel = closedForm
End Sub
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.Alt Or e.KeyCode = Keys.F4 Then
closedForm = True
Else
closedForm = False
End If
End Sub

Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
closedForm = False
End Sub
End Class

You can make so by allowing your program to run as service or application.
To make your program run like application;
To Make a program start as soon as the system starts, copy it to the startup on your program menu manually.
I will late wrote and send to you hw to make service based programs.

Take care and bye for now.
Re: Post Ur Vb.net Questions Here by fatezy(m): 9:18am On May 15, 2009
thanks a lot,
i'll be waiting for the other post.
Re: Post Ur Vb.net Questions Here by fatezy(m): 11:03pm On May 30, 2009
Hello mr lucky, Hope u'v not forgotten me, Still need the code to run an application @ system startup, Hopin for soonest reply
Re: Post Ur Vb.net Questions Here by luckyCO(m): 12:40pm On May 31, 2009
I almost have forgotten.
A little busy, will write it and finally send it to you.
Re: Post Ur Vb.net Questions Here by fatezy(m): 1:31pm On May 31, 2009
Thanks in anticipation
Re: Post Ur Vb.net Questions Here by moore20: 7:01pm On Feb 05, 2010
hi lucky am new into vb.net please i need u to do me a favour
1. hw do i connect 2 combo's e.g state and lga, to show local government of any selected state
2. how do i connect my application to a database e.g mysql server 2008

thanks
Re: Post Ur Vb.net Questions Here by luckyCO(m): 11:41am On Feb 19, 2010
moore20:

hi lucky am new into vb.net please i need u to do me a favour
1. hw do i connect 2 combo's e.g state and lga, to show local government of any selected state
2. how do i connect my application to a database e.g mysql server 2008

thanks

Question 1:
Your question requires little know logic otherwise known as database normalization.
You have to build a database followed by two tables ,namely eg tblState and tblLGA

Am using MYSQL datatypes please,check for the equivalent in SQL server.
with the follwing fields

tblState
StateID=Auto Increment ID
StateName= Varchar(100)
RecordStatus=tinyInt default=1

RecordStatus will help you to stop or allow a particular State from being displayed.

tblLGA
LGAID=Auto Increament ID
LGAName= varchar(200)
StateID=Int
RecordStatus=tinyint default=1

RecordStatus will help you to stop or allow a particular LGA from being displayed.

U may use database connection wizard.

You may decide to show fill the record in another combo or datagridview

dim Server_name as string ="<servername>"
dim Database as string ="<database name>"

dim _ConnectionString as string= "Data Source=" & Server_name & ";" & "Initial Catalog=" & Database & ";" & _
"Integrated Security=True;Pooling=False"

dim _CommandText as string="Select Statname from tblState where recordstatus=1
dim ds as new dataset
Dim OleDb As SqlDataAdapter = New SqlDataAdapter(_CommandText, _ConnectionString)
OleDb.Fill(ds, "Table"wink

combostate.datasource=ds.Tables(0)


For LGA fill

double click at the combostate state control
and in selectedindexchange event enter the following codes;

Private Sub combostate_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboAbnormalDigit.SelectedIndexChanged

dim W as string ="Select StateID from tblState where StateName='" & combostate.text & "'"
dim stateID as int32=val(getSingleValue(w))

_CommandText="Select LGAName from tblLGA wher StateID=" & stateID & " AND Recordstatus=1"
dim ds as new dataset
Dim OleDb As SqlDataAdapter = New SqlDataAdapter(_CommandText, _ConnectionString)
OleDb.Fill(ds, "Table"wink

comboLGA.datasource=ds.Tables(0)
End Sub

Public Function getSingleValue(_CommandText as string ) As String
dim da as new dataset
Dim OleDb As SqlDataAdapter = New SqlDataAdapter(_CommandText, _ConnectionString)
OleDb.Fill(da, "Table"wink

Try
If da.Tables(0).Rows.Count > 0 Then
Return IIf((da.Tables(0).Rows(0).Item(0) Is DBNull.Value) = True, "", da.Tables(0).Rows(0).Item(0).ToString)
Else
Return ""
End If

Catch ex As Exception

End Try

Return ""
End Function

Hope this helps
Re: Post Ur Vb.net Questions Here by moore20: 7:15pm On Feb 19, 2010
thanks a million lucky just checked and saw ur message now i'll try it and get back to u very grateful.
Re: Post Ur Vb.net Questions Here by luckyCO(m): 11:38pm On Feb 22, 2010
Good, waiting incase if u have any more question
Re: Post Ur Vb.net Questions Here by luckyCO(m): 6:12pm On Feb 16, 2011
Am back, was busy with many projects.
You can ask your questions and I will attend to them now.
Thanks
Re: Post Ur Vb.net Questions Here by luckyCO(m): 4:38am On Feb 17, 2011
Hope no more questions
Re: Post Ur Vb.net Questions Here by luckyCO(m): 3:33pm On Feb 17, 2011
Later I will post windows service I downloaded and modified for anyone who may need it.
Re: Post Ur Vb.net Questions Here by Nobody: 11:16am On Feb 24, 2011
I need help to writing a question and answer program dat can be interactive. something like who wants to be a millionair.
how possible is it.
Re: Post Ur Vb.net Questions Here by luckyCO(m): 10:59pm On Feb 24, 2011
Very much possible.
You have to design your programs.
You have to gather questions and answer.

You must modeled your database in a way to contain questions and answer and score and again you design logic that will tell you the step where the person will get to and once fail will fall back.

Then you build logic that guess your answer. These should accompany each question.

After modeling the database, then you have little work to do.
Re: Post Ur Vb.net Questions Here by bobjr: 10:01pm On Feb 28, 2011
Greetings all

I just joined this forum , please advise smiley
Re: Post Ur Vb.net Questions Here by luckyCO(m): 5:46pm On Mar 01, 2011
bobjr:

Greetings all

I just joined this forum , please advise smiley

You hv to be specific! where do you need advice and on what do you need advice on?
Re: Post Ur Vb.net Questions Here by bobjr: 5:57pm On Mar 01, 2011
I just need peace now, because my mind is not good anymore hahahahaha, just kidding
Re: Post Ur Vb.net Questions Here by luckyCO(m): 1:16pm On Mar 10, 2011
No more questions?

(1) (2) (Reply)

How Facebook Manages It Users Database / Programming Challenge / Tried To Hire A Programmer In Lagos Today He Told Me $100 A Day Or Forget

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 30
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.