Click here to Skip to main content
15,904,935 members
Home / Discussions / C#
   

C#

 
QuestionLinq To SQL Query Not Working - Null Problem Pin
Kevin Marois18-Mar-13 20:40
professionalKevin Marois18-Mar-13 20:40 
AnswerRe: Linq To SQL Query Not Working - Null Problem Pin
Freak3019-Mar-13 0:25
Freak3019-Mar-13 0:25 
GeneralRe: Linq To SQL Query Not Working - Null Problem Pin
Kevin Marois19-Mar-13 5:00
professionalKevin Marois19-Mar-13 5:00 
AnswerRe: Linq To SQL Query Not Working - Null Problem Pin
Mycroft Holmes19-Mar-13 0:28
professionalMycroft Holmes19-Mar-13 0:28 
GeneralRe: Linq To SQL Query Not Working - Null Problem Pin
Freak3019-Mar-13 22:17
Freak3019-Mar-13 22:17 
Questionsocket in service WCF Pin
ibrahimCA18-Mar-13 10:55
ibrahimCA18-Mar-13 10:55 
AnswerRe: socket in service WCF Pin
Richard MacCutchan18-Mar-13 23:27
mveRichard MacCutchan18-Mar-13 23:27 
GeneralRe: socket in service WCF Pin
Nand3219-Mar-13 20:53
Nand3219-Mar-13 20:53 
GeneralRe: socket in service WCF Pin
Richard MacCutchan19-Mar-13 22:45
mveRichard MacCutchan19-Mar-13 22:45 
QuestionUSB To Serial Adapter speed Pin
C-P-User-318-Mar-13 10:07
C-P-User-318-Mar-13 10:07 
AnswerRe: USB To Serial Adapter speed Pin
dusty_dex18-Mar-13 12:29
dusty_dex18-Mar-13 12:29 
JokeRe: USB To Serial Adapter speed Pin
PIEBALDconsult18-Mar-13 13:16
mvePIEBALDconsult18-Mar-13 13:16 
AnswerRe: USB To Serial Adapter speed Pin
C-P-User-319-Mar-13 5:55
C-P-User-319-Mar-13 5:55 
QuestionProblem With Voice Chat Application Pin
Ǯmr MànďǾǿ18-Mar-13 9:27
Ǯmr MànďǾǿ18-Mar-13 9:27 
AnswerRe: Problem With Voice Chat Application Pin
Marco Bertschi18-Mar-13 11:38
protectorMarco Bertschi18-Mar-13 11:38 
AnswerRe: Problem With Voice Chat Application Pin
Marco Bertschi18-Mar-13 11:39
protectorMarco Bertschi18-Mar-13 11:39 
GeneralRe: Problem With Voice Chat Application Pin
Ǯmr MànďǾǿ18-Mar-13 11:52
Ǯmr MànďǾǿ18-Mar-13 11:52 
GeneralRe: Problem With Voice Chat Application Pin
Marco Bertschi18-Mar-13 21:29
protectorMarco Bertschi18-Mar-13 21:29 
Questionhow can i make a double click event in c# with access Pin
User349018-Mar-13 7:44
User349018-Mar-13 7:44 
AnswerRe: how can i make a double click event in c# with access Pin
Eddy Vluggen18-Mar-13 8:07
professionalEddy Vluggen18-Mar-13 8:07 
GeneralMessage Closed Pin
18-Mar-13 9:10
User349018-Mar-13 9:10 
GeneralRe: how can i make a double click event in c# with access Pin
Eddy Vluggen18-Mar-13 9:16
professionalEddy Vluggen18-Mar-13 9:16 
QuestionC# StreamReader Case sensitive Pin
Member 987302818-Mar-13 6:09
Member 987302818-Mar-13 6:09 
Hi All,

I just have a quick query, I am reasonably new to C#.

My program currently reads a text file and compares it with the value in a text box and then tells me how many matches, this currently works.

My query is that it is case sensitive. Is there any way to make it so it doesn't matter whether it is in upper or lower case?

Any help will be much appreciated!

Many thanks,

Katie.


This is my code:
C#
if (!String.IsNullOrEmpty(CustodianEAddress.Text))
{
    for (AddressLength1 = 0; AddressLength1 < Length; AddressLength1++)
    {
        List<string> list1 = new List<string>();
        using (StreamReader reader = new StreamReader(FileLocation))
        {
            string line1;
            //max 500
            string[] LineArray1 = new string[500];

            while ((line1 = reader.ReadLine()) != null)
            {
                list1.Add(line1); // Add to list.

                if (line1.IndexOf(cust1[AddressLength1].ToString()) != -1)
                {
                    count1++;
                    LineArray1[count1] = line1;
                }
            }

            reader.Close();
            using (System.IO.StreamWriter filed = 
               new System.IO.StreamWriter(FileLocation, true))
            {
                filed.WriteLine("");
                filed.WriteLine("The email address " + 
             cust1[AddressLength1].ToString() + " was found " + count1 +
             " times within the recipient's inbox");
            }

            string count1a;
            count1a = count1.ToString();
        }
    }
}
else
{
    MessageBox.Show("Please Enter an Email Address");
}


So basically, I need to compare the value in cust1[AddressLength1] with any values found in an array which is in the text file.

modified 18-Mar-13 14:04pm.

AnswerRe: C# StreamReader Case sensitive Pin
R. Giskard Reventlov18-Mar-13 6:41
R. Giskard Reventlov18-Mar-13 6:41 
GeneralRe: C# StreamReader Case sensitive Pin
Member 987302818-Mar-13 8:06
Member 987302818-Mar-13 8:06 

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.