Click here to Skip to main content
15,897,371 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: usercontrol caching Pin
marky77719-Jun-07 0:50
marky77719-Jun-07 0:50 
AnswerRe: usercontrol caching Pin
Nouman Bhatti19-Jun-07 1:52
Nouman Bhatti19-Jun-07 1:52 
QuestionHow can we use multiline and New line character in asp.net Pin
Hemant Garg18-Jun-07 22:40
Hemant Garg18-Jun-07 22:40 
AnswerRe: How can we use multiline and New line character in asp.net Pin
wEb GuRu...18-Jun-07 23:28
wEb GuRu...18-Jun-07 23:28 
QuestionCode failed to validate username Pin
ASPnoob18-Jun-07 21:50
ASPnoob18-Jun-07 21:50 
AnswerRe: Code failed to validate username Pin
Chetan Ranpariya18-Jun-07 21:56
Chetan Ranpariya18-Jun-07 21:56 
GeneralRe: Code failed to validate username Pin
ASPnoob18-Jun-07 22:07
ASPnoob18-Jun-07 22:07 
AnswerRe: Code failed to validate username Pin
Chetan Ranpariya18-Jun-07 23:17
Chetan Ranpariya18-Jun-07 23:17 
Hi,

I think you will have to change your query.
When commandtext of Command object is a SELECT statement you should not use ExecuteNonQuery() method on it coz this method returns the total number of affected row. here in SELECT query it is not affecting any row hence it will return "-1" always it doesnt matter what the SELECT query is returning.

So according to me you should change you 'SELECT' query and also should call ExecuteScalar method on your command object.
Your query should be as following
strSQL = String.Format("SELECT Count(UserName) FROM myTable WHERE (UserName='{0}');", txtUserName.Text)

and you should call the ExecuteScalar function on your command which will return the count of username found.

Dim result As Integer = CType(myCommand.ExecuteScalar, Integer)

Now if the username is not found in the table then result will have value ZERO (0) otherwise it will have the count of username found in the table.

I hope this will help you.

Thanks and Regards,
Chetan Ranpariya

AnswerRe: Code failed to validate username Pin
szukuro18-Jun-07 22:30
szukuro18-Jun-07 22:30 
QuestionItemInserted event & formview communication Pin
aitch4218-Jun-07 21:37
aitch4218-Jun-07 21:37 
Questionhow to get item template Pin
srinivassam18-Jun-07 21:31
srinivassam18-Jun-07 21:31 
AnswerRe: how to get item template Pin
Tarik Guney18-Jun-07 22:15
Tarik Guney18-Jun-07 22:15 
AnswerRe: how to get item template Pin
Nouman Bhatti19-Jun-07 1:58
Nouman Bhatti19-Jun-07 1:58 
QuestionRegarding Maverick.NET Pin
stkartik18-Jun-07 21:09
stkartik18-Jun-07 21:09 
QuestionHow to correct? Pin
Socheat.Net18-Jun-07 21:01
Socheat.Net18-Jun-07 21:01 
AnswerRe: How to correct? Pin
6-shooter18-Jun-07 21:15
6-shooter18-Jun-07 21:15 
GeneralRe: How to correct? Pin
MaheshSharma18-Jun-07 23:32
MaheshSharma18-Jun-07 23:32 
AnswerRe: How to correct? Pin
Venkatesh Mookkan18-Jun-07 21:18
Venkatesh Mookkan18-Jun-07 21:18 
GeneralRe: How to correct? Pin
Socheat.Net18-Jun-07 21:34
Socheat.Net18-Jun-07 21:34 
AnswerRe: How to correct? Pin
Jay_se18-Jun-07 21:19
Jay_se18-Jun-07 21:19 
GeneralRe: How to correct? Pin
Socheat.Net18-Jun-07 21:39
Socheat.Net18-Jun-07 21:39 
QuestionFrom browser itself print view..........., Pin
Member 387988118-Jun-07 21:00
Member 387988118-Jun-07 21:00 
QuestionPerfomrmance Measurement in asp.net Pin
Chetan Ranpariya18-Jun-07 20:55
Chetan Ranpariya18-Jun-07 20:55 
AnswerRe: Perfomrmance Measurement in asp.net Pin
Sandeep Akhare18-Jun-07 21:31
Sandeep Akhare18-Jun-07 21:31 
GeneralRe: Perfomrmance Measurement in asp.net Pin
Chetan Ranpariya18-Jun-07 21:34
Chetan Ranpariya18-Jun-07 21:34 

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.