Click here to Skip to main content
15,916,601 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: problem when exporting datagrid to excel Pin
ii_noname_ii6-Aug-06 22:40
ii_noname_ii6-Aug-06 22:40 
QuestionDateTimePicker Pin
Maira K6-Aug-06 22:05
Maira K6-Aug-06 22:05 
QuestionSimulate Mouse Click without using API Pin
The ANZAC6-Aug-06 22:04
The ANZAC6-Aug-06 22:04 
AnswerRe: Simulate Mouse Click without using API Pin
Colin Angus Mackay6-Aug-06 22:22
Colin Angus Mackay6-Aug-06 22:22 
GeneralRe: Simulate Mouse Click without using API Pin
The ANZAC6-Aug-06 23:35
The ANZAC6-Aug-06 23:35 
Questionchange password Pin
pratap ankesh6-Aug-06 19:52
pratap ankesh6-Aug-06 19:52 
AnswerRe: change password Pin
hansemann6-Aug-06 21:17
hansemann6-Aug-06 21:17 
Questiondisplaying info from database [urgent pls help] Pin
kyosugi6-Aug-06 4:40
kyosugi6-Aug-06 4:40 
1st, i check for a valid id for the user n if its valid, a new form will show
the new form contains textboxes and a combo box
i would wan the textboxes and the combo box to display the corresponding stuff from the database
for exmaple
name: my name
address : my address

the followin is the code i used

--------
this 1 is which i validate the id, it works, but jus in case i wana know if the other code did not work because of it
--------
Private Sub submitB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submitB.Click
Dim strcon As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Jasmine\My Documents\project\db1.mdb"
Dim con As OleDb.OleDbConnection
Dim dr As OleDb.OleDbDataReader
Dim cmd As New OleDb.OleDbCommand

Try

Dim strselect As String = "Select BorrowerId from member where BorrowerId = '" & idTB.Text & "'"

'create a new connection
con = New OleDb.OleDbConnection(strcon)
con.Open()
cmd.Connection = con
cmd.CommandText = strselect
dr = cmd.ExecuteReader


If dr.Read Then


If idTB.Text = dr("BorrowerId") Then
MessageBox.Show("Valid Id")
EditMember.Show()

End If
Else

MessageBox.Show("Invalid Id")

End If

If idTB.Text = "" Then
MessageBox.Show("Please Enter The BorrowerID")
End If

dr.Close()

Catch eException As Exception
MessageBox.Show(eException.Message)
End Try

End Sub


--------
this 1 is where i wan the info to display out on the textboxes n combo box
--------
Private Sub EditMember_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strcon As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source =C:\Documents and Settings\Jasmine\My Documents\project\db1.mdb"
Dim con As OleDb.OleDbConnection
Dim dr As OleDb.OleDbDataReader
Dim cmd As New OleDb.OleDbCommand
Try
Dim strselect As String = "Select Fname, Lname, Address1, Address2, Address3, ContactNo, HandPhNo, Email, CourseOfStudy from member where BorrowerId = '" & EditMemberLog.idTB.Text & "'"

'create a new connection
con = New OleDb.OleDbConnection(strcon)
con.Open()
cmd.Connection = con
cmd.CommandText = strselect
dr = cmd.ExecuteReader(CommandBehavior.SingleRow Or CommandBehavior.CloseConnection)

If dr.Read Then
Me.fNameTB.Text = dr("Fname")
Me.lNameTB.Text = dr("Lname")
Me.add1TB.Text = dr("Address1")
Me.add2TB.Text = dr("Address2")
Me.add3TB.Text = dr("Address3")
Me.hmTB.Text = dr("ContactNo")
Me.hpTB.Text = dr("HandPhNo")
Me.emailTB.Text = dr("Email")
Me.cosCB.Text = dr("CourseOfStudy")

End If
dr.Close()


Catch eException As Exception
MessageBox.Show(eException.Message)
End Try

End Sub
---------------------

pls, i need help asap...my tis proj is dued tml 9am >.<
oh btw, tis is my 1st proj on vb so...er, nothing too complicated pls >.<
GeneralRe: displaying info from database [urgent pls help] Pin
Dave Sexton7-Aug-06 2:19
Dave Sexton7-Aug-06 2:19 
Questionmp3 file Pin
md_refay6-Aug-06 2:59
md_refay6-Aug-06 2:59 
AnswerRe: mp3 file Pin
Thomas Stockwell7-Aug-06 11:58
professionalThomas Stockwell7-Aug-06 11:58 
GeneralRe: mp3 file Pin
husni.adil10-Aug-06 17:44
husni.adil10-Aug-06 17:44 
QuestionC++ to VB.Net Pin
KoolJboy6-Aug-06 1:21
KoolJboy6-Aug-06 1:21 
AnswerRe: C++ to VB.Net Pin
Christian Graus6-Aug-06 1:27
protectorChristian Graus6-Aug-06 1:27 
GeneralRe: C++ to VB.Net Pin
KoolJboy6-Aug-06 2:31
KoolJboy6-Aug-06 2:31 
QuestionHow to differ between two same event in the same control ? Pin
Assaf826-Aug-06 0:23
Assaf826-Aug-06 0:23 
AnswerRe: How to differ between two same event in the same control ? Pin
Christian Graus6-Aug-06 1:39
protectorChristian Graus6-Aug-06 1:39 
GeneralRe: How to differ between two same event in the same control ? Pin
Assaf826-Aug-06 6:41
Assaf826-Aug-06 6:41 
GeneralRe: How to differ between two same event in the same control ? [modified] Pin
Thomas Stockwell7-Aug-06 12:04
professionalThomas Stockwell7-Aug-06 12:04 
QuestionData report error....Help~urgent~~~ Pin
campbells5-Aug-06 21:51
campbells5-Aug-06 21:51 
Questionnetworking query Pin
Bhavik N Parekh5-Aug-06 20:03
Bhavik N Parekh5-Aug-06 20:03 
AnswerRe: networking query Pin
Colin Angus Mackay5-Aug-06 21:02
Colin Angus Mackay5-Aug-06 21:02 
AnswerRe: networking query Pin
Craster7-Aug-06 5:25
Craster7-Aug-06 5:25 
Questionpermission Pin
md_refay5-Aug-06 11:20
md_refay5-Aug-06 11:20 
AnswerRe: permission Pin
Mekong River6-Aug-06 2:12
Mekong River6-Aug-06 2:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.