Click here to Skip to main content
15,924,901 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to send and receive e-mails in windows application? Pin
hgs24shravgi17-Oct-07 20:36
hgs24shravgi17-Oct-07 20:36 
GeneralRe: How to send and receive e-mails in windows application? Pin
hgs24shravgi19-Oct-07 0:12
hgs24shravgi19-Oct-07 0:12 
Questiondata insertion Pin
BasharatAli16-Oct-07 21:06
BasharatAli16-Oct-07 21:06 
AnswerRe: data insertion Pin
Salman Sheikh16-Oct-07 21:26
Salman Sheikh16-Oct-07 21:26 
GeneralRe: data insertion Pin
BasharatAli16-Oct-07 21:28
BasharatAli16-Oct-07 21:28 
QuestionHow to run a DOS process and get ErrorLevel Pin
edmonson16-Oct-07 20:53
edmonson16-Oct-07 20:53 
AnswerRe: How to run a DOS process and get ErrorLevel Pin
Luc Pattyn17-Oct-07 2:39
sitebuilderLuc Pattyn17-Oct-07 2:39 
QuestionHow To Use ? Pin
Satish_S16-Oct-07 20:03
Satish_S16-Oct-07 20:03 
hai,

I have tried to use 3 layers
Presentation Layer,business Logic Layer, Data Access Layer
Just i Have tried,tell whether this is correct or not?

In My Presentation Layer[tUserPL.aspx]
i have two textbox one for UserName and other for password

<code>
Dim i As String
Dim UserBLL As New UserBLL

Private Sub btnSubmit_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.ServerClick
Try
UserBLL.User_Name = Me.txtuser.Value
UserBLL.User_Pass = Me.txtPass.Value

i = UserBLL.Verify()
If i > 1 Then
Response.Redirect("\IPB\tBillCorrectionA.aspx")
Else
Response.Write("Not an Authorized User")
End If

Catch ex As Exception
Response.Write(ex.Message.ToString())
End Try
End Sub

</code>


In My business Logic Layer[UserBLL.aspx] i Have the Following,



<code>

Public Class UserBLL
Public err, cmd_value, qry_value As String
Dim UserData As New UserDAL
Dim sqlconn As New SqlClient.SqlConnection
Public Property User_Name() As String
Get
Return cmd_value
End Get
Set(ByVal Value As String)
cmd_value = Value
End Set
End Property
Public Property User_Pass() As String
Get
Return qry_value
End Get
Set(ByVal Value As String)
qry_value = Value
End Set
End Property

Public Function Verify()
Dim sqlcmd As SqlClient.SqlCommand
Dim i As Integer
Me.sqlconn.ConnectionString = ConfigurationSettings.AppSettings("BB_CONSTR")
Me.sqlconn.Open()
Return UserData.ExecuteMsgQuery("select count(*) from mast_users where cLogin like '" & User_Name & "' and cPassword like '" & User_Pass & "'", sqlconn)
End Function

End Class
</code>

In My Data Access Layer[UserDAL.aspx] i Have following

<code>
Public Class UserDAL


Public Shared Function ExecuteMsgQuery(ByVal selQuery As String, ByVal myCon As SqlClient.SqlConnection) As Int16
Try
Dim SqlAdpt As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(selQuery, myCon)
If SqlAdpt.SelectCommand.ExecuteScalar > 0 Then
Return 2
Else
Return 1
End If
Catch ex As Exception
Return 3
Finally
End Try
End Function

</code>

In above i have tried to get a concept but i think i am not in correct way and
i need a result like verfying the user name and password and return back to BLL
i am not getting any error and i am redirecting to another page after verifying user name and password. after i am getting correct as result i need to proceed the same concept in my project. help me out...



sathimailin
AnswerRe: How To Use ? Pin
Vimalsoft(Pty) Ltd16-Oct-07 21:06
professionalVimalsoft(Pty) Ltd16-Oct-07 21:06 
Questionhow to do datecalculations? Pin
sathyan_829416-Oct-07 19:56
sathyan_829416-Oct-07 19:56 
AnswerRe: how to do datecalculations? Pin
Guffa16-Oct-07 21:09
Guffa16-Oct-07 21:09 
GeneralRe: how to do datecalculations? Pin
Salman Sheikh17-Oct-07 22:44
Salman Sheikh17-Oct-07 22:44 
Questionexecuting Pin
SreejithAchutan16-Oct-07 19:32
SreejithAchutan16-Oct-07 19:32 
AnswerRe: executing Pin
Vimalsoft(Pty) Ltd16-Oct-07 21:31
professionalVimalsoft(Pty) Ltd16-Oct-07 21:31 
AnswerRe: executing Pin
Dave Kreskowiak17-Oct-07 2:02
mveDave Kreskowiak17-Oct-07 2:02 
QuestionTracking Tab Key Press in DataGridView Pin
SekharOne16-Oct-07 18:58
SekharOne16-Oct-07 18:58 
AnswerRe: Tracking Tab Key Press in DataGridView Pin
Dave Kreskowiak17-Oct-07 2:03
mveDave Kreskowiak17-Oct-07 2:03 
GeneralRe: Tracking Tab Key Press in DataGridView Pin
Salman Sheikh17-Oct-07 22:46
Salman Sheikh17-Oct-07 22:46 
GeneralRe: Tracking Tab Key Press in DataGridView Pin
SekharOne17-Oct-07 23:48
SekharOne17-Oct-07 23:48 
GeneralRe: Tracking Tab Key Press in DataGridView Pin
Dave Kreskowiak18-Oct-07 2:07
mveDave Kreskowiak18-Oct-07 2:07 
QuestionTextBox Problem Pin
MikeMarq16-Oct-07 16:40
MikeMarq16-Oct-07 16:40 
AnswerRe: TextBox Problem Pin
Christian Graus16-Oct-07 18:27
protectorChristian Graus16-Oct-07 18:27 
GeneralRe: TextBox Problem Pin
MikeMarq16-Oct-07 18:48
MikeMarq16-Oct-07 18:48 
GeneralRe: TextBox Problem Pin
Dave Kreskowiak17-Oct-07 1:57
mveDave Kreskowiak17-Oct-07 1:57 
QuestionExecute SQL Server Report Service from VB6 Pin
QPun16-Oct-07 15:40
QPun16-Oct-07 15:40 

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.