{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lab7 - {Lawns-firewall Labz-oeadrpenersonmpes'gg |...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: {Lawns-firewall Labz-oeadrpenersonmpes'gg] | DamSa'viceJd: l 1 OOButtonl Lg ii click 'LabTHeidiPeterson — Public Class LabTHeidiPeterson J: Private Sub Button1_Click [ByVal sender As System.0hject, ByVal e As System.EventBrgs) Handles Button1.Click 'validate the user's input to the textbox If txtUserName.Text = "" Then lthesult.Text = "You must enter something in the textbox" Else 'if valid, search for the password Dim objDataService As New DataService obj DataService . SearchItem = txtUse rName . Text lthesult.Text = "Your password is" l; objDataService.G-etData End If End Sub End Class [0:3me @ EOGemata ' Lab'FHeidiPe terson I Imports System.Data.OleDb ElPublic Class DataService Public SearchItem As String — Public Function GetData[} As String Dim cn As New OleDbConnection Dim on As New OleDbCommand Dim da As New OleDbDataMapter Dim ds As New DataSet Dim result As String 'Set Connection String 'Hicrosoft .ACE . OLEDB. 12 . 0 'link the command to the connection cm. Connection = cn 'Set up your SQL string cm.CommandText = I"'select * from logindata where uname='" & SearchItem & """"' 'link the data adapter to the command object da.SelectCommand = cm 'excute the SQL statement and fill up the dataset da.E‘ill Lds] 'check if anything was found and display the search results If ds.Tables[0) .Rows.Count = 0 Then result = "Username not found" Else result = ds.Tables [0:- .Rows [0] .Item {"pword") End If Return result — End Function —End Class cn. ConnectionString = "ProvideFI-[icrosoft .ACE .OLEDB. 12 . 0: Data Source=| DataDirectoryl \LoginData. accdb: " ' l'rmLabFHE-i‘dipeterson ' frmLabTHE-idiPeterson YMpamold BUmane not fund In this weeks lab 7 instructions, this says "UserName Not Found." Butas you can .ee mine is adding "Your password is." I ent to the Button_Click and DataService and mine looks the same as the instructions. Can you help please? ...
View Full Document

{[ snackBarMessage ]}

Page1 / 3

Lab7 - {Lawns-firewall Labz-oeadrpenersonmpes'gg |...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online