manjusha s wrote:
.bt when i take rs[1] instead of rs[31],then error is like unsuccessful login
Well, that's what your code is supposed to say when you type a wrong password. This is what happens, whit rs[2];
Here you check whether username and password combination are present in the database
if ((rs[0].ToString() == T1.Text) && (rs[31].ToString()== T2.Text))
If they don't exist, then the computer will execute the else-part;
else<br />{<br />Response.Write("Unsuccessful Login");<br /><br />T2.Text = "";<br />T2.Focus();<br />}<br />
There is your message. Shouldn't happen when you use a password that is in the database.
Now, when you simply change the number of the index to 31, your code becomes broken; there aren't 31 fields in that query, so it tries to read from memory that ain't there.
select UserName,Login_Password from RegistrationForm
returns two fields, not 31.