Click here to Skip to main content
15,892,674 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionAddint items to a combobox Pin
Dave McCool19-Nov-07 0:36
Dave McCool19-Nov-07 0:36 
AnswerRe: Addint items to a combobox Pin
AliAmjad19-Nov-07 2:49
AliAmjad19-Nov-07 2:49 
GeneralRe: Addint items to a combobox Pin
Luc Pattyn19-Nov-07 10:12
sitebuilderLuc Pattyn19-Nov-07 10:12 
GeneralRe: Addint items to a combobox Pin
Dave McCool20-Nov-07 23:02
Dave McCool20-Nov-07 23:02 
Questionhow 2 send pic with mail plz help! Pin
King of Kingz19-Nov-07 0:13
King of Kingz19-Nov-07 0:13 
AnswerRe: how 2 send pic with mail plz help! Pin
_mubashir19-Nov-07 2:00
_mubashir19-Nov-07 2:00 
AnswerRe: how 2 send pic with mail plz help! Pin
AliAmjad19-Nov-07 3:02
AliAmjad19-Nov-07 3:02 
QuestionIndexOutOfRange..please help Pin
kc_renji18-Nov-07 22:48
kc_renji18-Nov-07 22:48 
I am having a problem with the MemberUsername record in my datMember table.
I got the error "IndexOutOfRangeException Was Unhandled by user code when i tried to run my application.
I double check the database.
I declare the MemberUsername as varchar 50
Is tat cause the IndexOutOfRange?
I also have checked the uppercase and lowercase letter too..Nothing is wrong with that..
What would be the problem?
Your help is very much appreciated to me as a beginner..thanks a lot.


Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click

Dim conMbr As New SqlConnection
Dim cmdMbr As New SqlCommand
Dim sqlReader As SqlDataReader

Dim strVerifyMbr As String

conMbr = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Program
Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\GpsCinema.mdf';Initial Catalog=GpsCinema;Persist Security Info=True;User ID=sa;Password=password;MultipleActiveResultSets=True;Connect Timeout=30;User Instance=False;Context Connection=False")
conMbr.Open()

strVerifyMbr = "SELECT MemberId FROM datMember WHERE memberUserName='" + txtUserId.Text + "' AND memberPassword='" + txtPwd.Text + " '"

cmdMbr = New SqlCommand(strVerifyMbr, conMbr)

Dim checkUsr As String = ""

sqlReader = cmdMbr.ExecuteReader

While sqlReader.Read

D'Oh! | :doh: If txtUserId.Text = Convert.ToString(sqlReader("MemberUsername")) Then

If txtPwd.Text = Convert.ToString(sqlReader("memberPassword")) Then
Session("username") = sqlReader("memberUsername")
Session("password") = sqlReader("memberPassword")

Server.Transfer("MainUser.aspx")

Else
Response.Write("window.alert('Invalid Password. Please try again.');<" + "/script>")
Server.Transfer("MainUser.aspx")
End If
End If
checkUsr = "Failed"

End While

If checkUsr = "Failed" Then
Response.Write("<SCRIPT lanquage='JScript'>window.alert('Invalid Username! Please Try Again.');<" + "/SCRIPT>")
Server.Transfer("MainUser.aspx")
End If

conMbr.Close()
End Sub

<div class="ForumSig">Life is up and down
Nevertheless,never give up hope and be confident to yourself</div>
AnswerRe: IndexOutOfRange..please help Pin
Colin Angus Mackay18-Nov-07 22:58
Colin Angus Mackay18-Nov-07 22:58 
GeneralRe: IndexOutOfRange..please help Pin
kc_renji18-Nov-07 23:02
kc_renji18-Nov-07 23:02 
AnswerRe: IndexOutOfRange..please help Pin
Colin Angus Mackay18-Nov-07 23:00
Colin Angus Mackay18-Nov-07 23:00 
GeneralRe: IndexOutOfRange..please help Pin
kc_renji18-Nov-07 23:05
kc_renji18-Nov-07 23:05 
GeneralRe: IndexOutOfRange..please help Pin
Colin Angus Mackay18-Nov-07 23:47
Colin Angus Mackay18-Nov-07 23:47 
GeneralRe: IndexOutOfRange..please help Pin
kc_renji18-Nov-07 23:07
kc_renji18-Nov-07 23:07 
GeneralRe: IndexOutOfRange..please help Pin
Colin Angus Mackay18-Nov-07 23:50
Colin Angus Mackay18-Nov-07 23:50 
GeneralRe: IndexOutOfRange..please help Pin
kc_renji27-Nov-07 5:43
kc_renji27-Nov-07 5:43 
Questionvb2005 Pin
vb.net818-Nov-07 22:05
vb.net818-Nov-07 22:05 
AnswerRe: vb2005 Pin
DigiOz Multimedia19-Nov-07 8:55
DigiOz Multimedia19-Nov-07 8:55 
AnswerRe: vb2005 Pin
nishkarsh_k19-Nov-07 16:38
nishkarsh_k19-Nov-07 16:38 
QuestionHow to save datagridview contents into xml and retrieve the same Pin
VB 8.018-Nov-07 20:37
VB 8.018-Nov-07 20:37 
Questioncode error Pin
kc_renji18-Nov-07 20:36
kc_renji18-Nov-07 20:36 
AnswerRe: code error Pin
pmarfleet18-Nov-07 21:27
pmarfleet18-Nov-07 21:27 
GeneralRe: code error Pin
kc_renji18-Nov-07 22:07
kc_renji18-Nov-07 22:07 
QuestionDataGridView autogenerated columns Pin
divyesh143218-Nov-07 20:05
divyesh143218-Nov-07 20:05 
AnswerRe: DataGridView autogenerated columns Pin
Dave Kreskowiak19-Nov-07 10:09
mveDave Kreskowiak19-Nov-07 10:09 

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.