15,897,273 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by badri2020 (Top 11 by date)
badri2020
30-Aug-10 8:21am
View
but it has not shown the error on lines wat you told...still there is error in verify function in application tier..still i cannot debug it
badri2020
30-Aug-10 7:57am
View
i>
application tier:
Imports System.Data
Imports System.Data.SqlClient
Imports System.Security.Principal
Imports System.Threading
Imports System.IO
Imports System.Text
Imports System.Collections.Generic
Imports bal.cbal
Namespace app
End Namespace
Public Class capp
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Dim verify As New bal.cbal
Dim dat As New bal.cbal
Dim use As String = UsernameTextBox.Text
Dim pas As String = PasswordTextBox.Text
verify(use, pas)
Me.Close()
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
Private Sub capp_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'LoginDataSet.details' table. You can move, or remove it, as needed.
Me.DetailsTableAdapter.Fill(Me.LoginDataSet.details)
End Sub
End Class
business logic tier:
Imports System.Data
Imports System.Data.SqlClient
Imports System.Security.Principal
Imports System.Threading
Imports System.IO
Imports System.Text
Namespace cbal
Public Class bal
Dim check As New dal.cdal
Dim myDS As dal.cdal
Dim loginattempts As Integer
Public Function verify(ByVal use As String, ByVal pas As String) As String
If (use.Length > 10) Then
Throw New Exception("username must be atleast 10 characters")
ElseIf (pas.Length > 6) Then
Throw New Exception("password must be atleast 6 charcters long")
End If
loginattempts += 1
If loginattempts >= 3 Then
MsgBox("Too many failed login attempts", MsgBoxStyle.Exclamation)
Else
MsgBox("User Name not found. Please try again", MsgBoxStyle.Exclamation)
End If
Return myDS
End Function
End Class
End Namespace
data tier:
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports System.Security.Principal
Imports System.Threading
Imports System.IO
Namespace dal
Public Class cdal
Dim strConnect As String = "Data Source=pc325;Initial Catalog=pubs;Integrated Security=SSPI;"
Dim Con As SqlConnection = New SqlConnection(strConnect)
Dim login As Object
Dim mySDA As Object
Dim myDS As Object
Sub Main()
Try
Con.Open()
Console.WriteLine("Connection Opened")
Catch ex As SqlException
Console.WriteLine("Error: " & ex.ToString())
Finally
Con.Close()
Console.WriteLine("Connection Closed")
End Try
End Sub
Public Function check(ByVal use As String, ByVal pas As String)
If (use = use And pas = pas) Then
Console.WriteLine("login success")
Else
Console.WriteLine("Invalid name/password")
End If
Dim com As New SqlCommand("select * from details where use ='" & use & "'pas ='" & pas & "'", Con)
Dim SqlDataAdapter As New mySDA
Dim mySDA As New SqlDataAdapter(login)
Dim DataSet As New myDS
mySDA.Fill(myDS) 'cmdObj.Dispose()
Con.Close()
Return myDS
End Function
Private Sub SqlDataAdapter(ByVal p1 As Object)
Throw New NotImplementedException
End Sub
End Class
End Namespace
k..
the error s coming in application tier..
it s giving the error on line 19 tat Class 'WindowsApplication2.bal.cbal' cannot be indexed because it has no default property
badri2020
30-Aug-10 7:54am
View
if i keep the end namespace atlast in the program it gives error in design..so only i hav written the code like that
badri2020
30-Aug-10 7:48am
View
Reason for my vote of 3
ghgh
badri2020
30-Aug-10 7:47am
View
i hav instantiated all classes with the new keyword...plz tell me on which line i ve to instantiate the class..i can't find wat u r telling
badri2020
30-Aug-10 7:02am
View
no..it doesn't works..give me some alternative methods
badri2020
30-Aug-10 6:23am
View
s..i hav corrected it also
badri2020
30-Aug-10 6:11am
View
after doing wat u hav told...still i cannot recover from the error..
badri2020
30-Aug-10 5:22am
View
hi,
in which line has the error occured..
i hav declared all things correctly
badri2020
30-Aug-10 5:04am
View
Deleted
here is my code for
application tier:
Imports System.Data
Imports System.Data.SqlClient
Imports System.Security.Principal
Imports System.Threading
Imports System.IO
Imports System.Text
Imports System.Collections.Generic
Imports bal.cbal
Namespace app
End Namespace
Public Class capp
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Dim verify As New bal.cbal
Dim dat As New bal.cbal
Dim use As String = UsernameTextBox.Text
Dim pas As String = PasswordTextBox.Text
verify(use, pas)
Me.Close()
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
Private Sub capp_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'LoginDataSet.details' table. You can move, or remove it, as needed.
Me.DetailsTableAdapter.Fill(Me.LoginDataSet.details)
End Sub
End Class
business logic tier:
Imports System.Data
Imports System.Data.SqlClient
Imports System.Security.Principal
Imports System.Threading
Imports System.IO
Imports System.Text
Namespace cbal
Public Class bal
Dim check As New dal.cdal
Dim myDS As dal.cdal
Dim loginattempts As Integer
Public Function verify(ByVal use As String, ByVal pas As String) As String
If (use.Length > 10) Then
Throw New Exception("username must be atleast 10 characters")
ElseIf (pas.Length > 6) Then
Throw New Exception("password must be atleast 6 charcters long")
End If
loginattempts += 1
If loginattempts >= 3 Then
MsgBox("Too many failed login attempts", MsgBoxStyle.Exclamation)
Else
MsgBox("User Name not found. Please try again", MsgBoxStyle.Exclamation)
End If
Return myDS
End Function
End Class
End Namespace
data tier
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports System.Security.Principal
Imports System.Threading
Imports System.IO
Namespace dal
Public Class cdal
Dim strConnect As String = "Data Source=pc325;Initial Catalog=pubs;Integrated Security=SSPI;"
Dim Con As SqlConnection = New SqlConnection(strConnect)
Dim login As Object
Dim mySDA As Object
Dim myDS As Object
Sub Main()
Try
Con.Open()
Console.WriteLine("Connection Opened")
Catch ex As SqlException
Console.WriteLine("Error: " & ex.ToString())
Finally
Con.Close()
Console.WriteLine("Connection Closed")
End Try
End Sub
Public Function check(ByVal use As String, ByVal pas As String)
If (use = use And pas = pas) Then
Console.WriteLine("login success")
Else
Console.WriteLine("Invalid name/password")
End If
Dim com As New SqlCommand("select * from details where use ='" & use & "'pas ='" & pas & "'", Con)
Dim SqlDataAdapter As New mySDA
Dim mySDA As New SqlDataAdapter(login)
Dim DataSet As New myDS
mySDA.Fill(myDS) 'cmdObj.Dispose()
Con.Close()
Return myDS
End Function
Private Sub SqlDataAdapter(ByVal p1 As Object)
Throw New NotImplementedException
End Sub
End Class
End Namespace
k..error s coming in application tier..
it s giving the error Class 'WindowsApplication2.bal.cbal' cannot be indexed because it has no default property on line 19
badri2020
27-Aug-10 9:54am
View
i am developing program to login a user thru his username and password..it s using 3 tier architecture..i hav created datasets and all other things related to the project..it s on development stage...but now it is giving error tat class(classname) cannot be indexed because it has no default value..i hav also searched several sites for help but i can't find the exact solution...
Show More