Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Error check Pin
Harsh Athalye5-Dec-14 0:14
Harsh Athalye5-Dec-14 0:14 
QuestionHow to copy a file from my computer to a shared folder of another computer with login username and password account Pin
Derz3-Dec-14 14:58
Derz3-Dec-14 14:58 
AnswerRe: How to copy a file from my computer to a shared folder of another computer with login username and password account Pin
PIEBALDconsult3-Dec-14 16:23
mvePIEBALDconsult3-Dec-14 16:23 
Questioninvalid length for a base-64 char array or string Pin
Jassim Rahma3-Dec-14 11:35
Jassim Rahma3-Dec-14 11:35 
SuggestionRe: invalid length for a base-64 char array or string Pin
Richard MacCutchan3-Dec-14 20:56
mveRichard MacCutchan3-Dec-14 20:56 
GeneralRe: invalid length for a base-64 char array or string Pin
Jassim Rahma3-Dec-14 22:27
Jassim Rahma3-Dec-14 22:27 
GeneralRe: invalid length for a base-64 char array or string Pin
Richard MacCutchan3-Dec-14 22:38
mveRichard MacCutchan3-Dec-14 22:38 
QuestionSetting an instance object equal to my empty string. Pin
Member 112838693-Dec-14 8:00
Member 112838693-Dec-14 8:00 
I can't explain it properly in the subject section, it's not as simple as that.

Here is the code snippet in question.

UserPass = reader["Password"].ToString();  


So UserPass is my string variable and reader is an SqlReader object.

Here is it being instantiated:

SqlDataReader reader = myCommand.ExecuteReader();


(myCommand is an SqlCommand obj)

reader["Password"] 


Password is a column name in my Sql DB. Basically I've just told the reader to go look within that column and used a query to specify where abouts.

I want to set the reader["Password"] equal to an empty string to compare against user input. Now there aren't any errors when I do this but it does throw an exception:

An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code


It doesn't give much more detail other than that and I'm not entirely sure what's wrong.
GeneralRe: Setting an instance object equal to my empty string. Pin
PIEBALDconsult3-Dec-14 8:07
mvePIEBALDconsult3-Dec-14 8:07 
GeneralRe: Setting an instance object equal to my empty string. Pin
Shweta N Mishra3-Dec-14 21:21
professionalShweta N Mishra3-Dec-14 21:21 
QuestionHow to send cell value from DataGrid to text file? Pin
Member 100245173-Dec-14 5:01
Member 100245173-Dec-14 5:01 
SuggestionRe: How to send cell value from DataGrid to text file? Pin
ZurdoDev3-Dec-14 5:14
professionalZurdoDev3-Dec-14 5:14 
AnswerRe: How to send cell value from DataGrid to text file? Pin
Richard MacCutchan3-Dec-14 6:31
mveRichard MacCutchan3-Dec-14 6:31 
GeneralRe: How to send cell value from DataGrid to text file? Pin
Member 100245173-Dec-14 7:41
Member 100245173-Dec-14 7:41 
QuestionCreate Hotel Room Booking Calendar Pin
KissGnv2-Dec-14 23:44
KissGnv2-Dec-14 23:44 
AnswerRe: Create Hotel Room Booking Calendar Pin
ixilom3-Dec-14 1:35
ixilom3-Dec-14 1:35 
GeneralRe: Create Hotel Room Booking Calendar Pin
KissGnv3-Dec-14 3:05
KissGnv3-Dec-14 3:05 
AnswerRe: Create Hotel Room Booking Calendar Pin
BillWoodruff3-Dec-14 1:36
professionalBillWoodruff3-Dec-14 1:36 
GeneralRe: Create Hotel Room Booking Calendar Pin
KissGnv3-Dec-14 3:11
KissGnv3-Dec-14 3:11 
GeneralRe: Create Hotel Room Booking Calendar Pin
BillWoodruff3-Dec-14 12:47
professionalBillWoodruff3-Dec-14 12:47 
GeneralRe: Create Hotel Room Booking Calendar Pin
PIEBALDconsult3-Dec-14 9:25
mvePIEBALDconsult3-Dec-14 9:25 
GeneralRe: Create Hotel Room Booking Calendar Pin
KissGnv3-Dec-14 20:23
KissGnv3-Dec-14 20:23 
GeneralRe: Create Hotel Room Booking Calendar Pin
BillWoodruff4-Dec-14 4:33
professionalBillWoodruff4-Dec-14 4:33 
AnswerRe: Create Hotel Room Booking Calendar Pin
syed shanu3-Dec-14 19:10
mvasyed shanu3-Dec-14 19:10 
AnswerRe: Create Hotel Room Booking Calendar Pin
SledgeHammer013-Dec-14 19:30
SledgeHammer013-Dec-14 19:30 

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.