473,408 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Need help fixing my Login Code in Visual Basic

My visual basic code is:

Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.  
  3.     Dim PasswordTrials As Integer
  4.  
  5.     Private Property TextPassword As Object
  6.  
  7.     Private Property TextUsername As Object
  8.  
  9.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  10.         Dim Login = Me.ClientsTableAdapter1.ClientQuery(TextUsername.Text, TextPassword.Text)
  11.  
  12.         If Login Is Nothing Then
  13.             MsgBox("Please Enter Your Login Details", MsgBoxStyle.Critical)
  14.             TextUsername.Value = ""
  15.             TextPassword.Value = ""
  16.             PasswordTrials = PasswordTrials + 1
  17.             If PasswordTrials >= 3 Then
  18.                 MsgBox("Login Attempts Exceeded, Spreadsheet Shutting Down", MsgBoxStyle.Critical)
  19.                 End
  20.             End If
  21.         Else
  22.             MsgBox("Login Successful, You Can Now Access The Spreadsheet", MsgBoxStyle.Information)
  23.             End
  24.         End If
  25.     End Sub
  26. End Class
  27.  
I am having "NullReferanceException was Unhandled" at this line "Dim Login = Me.ClientsTableAdapter1.ClientQuery(TextUsername.T ext, TextPassword.Text)"
Nov 8 '11 #1
0 1289

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ralph | last post by:
I used to have Visual Basic .net std. 2003 installed on WinXP SP1A. But I found it too hard to upgrade WinXP to SP2. Now, I do have WinXP SP2 installed, but I am having problems installing...
1
by: Tom Rahav | last post by:
Hello all! I develop application in Visual Basic .NET and ORACLE database. My question is how do I "send" script file to the database using visual basic .net. Other words, is there any way to...
4
by: Chris Asaipillai | last post by:
Hi there My compay has a number of Visual Basic 6 applications which are front endeed onto either SQL Server or Microsoft Access databases. Now we are in process of planning to re-write these...
2
by: Vmrincon | last post by:
Hi! I need to crete a visual basic .net application to read Excel 2000 files. Does anyone know if I need some kind of driver or some extra file to be able to do it? Thanks a lot!
0
by: shangardezi | last post by:
hi im a beginner with visual basic. I was wondering can someone tell me how i can somehow do a thing that when someone presses ok on the LOGIN FORM, the username and password is sent to my email. im...
2
by: terry guthrie | last post by:
I need some help with visual basic code, I need to create a timer that will be visible while playing a game, i know there is a timer in the tools that you pull over to the project and is hidden, and...
1
by: jschraer | last post by:
Need help! I installed Visual Basic Express 2008 on a Windows Vista Premium machine with 2.4 GHZ and 2 gigabyte of RAM. I start VB Express and choose File|New|Windows Forms Application. VB...
1
by: Bill Downing | last post by:
I need help finishing a visual basic program that converts SVG to HTML using LINQ. The input in svg.xml should produce the output in target.html Here is my svg.xml code: <?xml version="1.0"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.