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

C#

 
GeneralRe: error connection c# with oracle 11xe Pin
honar.cs7-Mar-14 1:14
honar.cs7-Mar-14 1:14 
QuestionExpandoObject and Serialization of Anonymous Types ? Pin
BillWoodruff6-Mar-14 15:48
professionalBillWoodruff6-Mar-14 15:48 
AnswerRe: ExpandoObject and Serialization of Anonymous Types ? Pin
Eddy Vluggen6-Mar-14 22:20
professionalEddy Vluggen6-Mar-14 22:20 
GeneralRe: ExpandoObject and Serialization of Anonymous Types ? Pin
BillWoodruff7-Mar-14 1:39
professionalBillWoodruff7-Mar-14 1:39 
AnswerRe: ExpandoObject and Serialization of Anonymous Types ? Pin
Eddy Vluggen7-Mar-14 6:49
professionalEddy Vluggen7-Mar-14 6:49 
GeneralRe: ExpandoObject and Serialization of Anonymous Types ? Pin
BillWoodruff7-Mar-14 14:11
professionalBillWoodruff7-Mar-14 14:11 
GeneralRe: ExpandoObject and Serialization of Anonymous Types ? Pin
Eddy Vluggen7-Mar-14 23:26
professionalEddy Vluggen7-Mar-14 23:26 
QuestionSystem.ArgumentOutOfRangeException: Index was out of range Pin
computerpublic6-Mar-14 5:34
computerpublic6-Mar-14 5:34 
C#
<pre>/*I have elimated some of the code in order to make it short and get straight to the point. I am noticing that my program will NOT process any of the non regular ascii characters (decimal 161 to 255 || hex A1 to FF) without the error below. All other regular ascii characters are process ok without errors.
OUTPUT::::::::::BELOW

count = 1
count = 3
count = 6

Unhandled Exception: System.ArgumentOutOfRangeException: Index was out of range.
 Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.BitArray.Get(Int32 index)
   at Applica.Program.Main(String[] args) in C:\Documents and Settings\shampro\D
esktop\Program.cs:line 55
Press any key to continue . . . 
*/
 
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Applica
{
    class Program
    {
        static void Main(string[] args)
        {
            DirectoryInfo da = new DirectoryInfo("C:\\Folder7");
            FileInfo[] Arr = da.GetFiles();
            if (Arr.Length == 0)
            {
                throw new InvalidOperationException("No files found.");
            }
            FileInfo ap = Arr[Arr.Length - 1];
            ulong Totbyte = (ulong)ap.Length;
            string filePath = ap.FullName;
            string temPath = Path.GetTempFileName();
            byte[] data = File.ReadAllBytes(filePath);
            File.WriteAllBytes(temPath, data);
            byte[] dataa = new byte[1];
            for (ulong counter = 0; counter < Totbyte; counter++)
            {
                dataa[0] = data[counter];
                BitArray bits = new BitArray(dataa);
                for (int count = 0; count < bits.Length;)
                {
                    if (count != 7)
                    {
                        if (bits[count] == false && bits[count + 1] == true)
                            count++;
                        if (bits[count] == false && bits[count + 1] == false)
                            count++;
                        if (bits[count] == true && bits[count + 1] == true)/////line 55 error
                            count++;
                        if (bits[count] == true && bits[count + 1] == false)
                            count++;
                        Console.WriteLine("count = {0}", count);
                    }
                }
            }
        }
    }
}



AnswerRe: System.ArgumentOutOfRangeException: Index was out of range Pin
Richard Andrew x646-Mar-14 5:42
professionalRichard Andrew x646-Mar-14 5:42 
GeneralRe: System.ArgumentOutOfRangeException: Index was out of range Pin
computerpublic6-Mar-14 5:48
computerpublic6-Mar-14 5:48 
GeneralRe: System.ArgumentOutOfRangeException: Index was out of range Pin
Richard Andrew x646-Mar-14 5:50
professionalRichard Andrew x646-Mar-14 5:50 
AnswerRe: System.ArgumentOutOfRangeException: Index was out of range Pin
Richard Deeming6-Mar-14 5:50
mveRichard Deeming6-Mar-14 5:50 
GeneralRe: System.ArgumentOutOfRangeException: Index was out of range Pin
computerpublic6-Mar-14 6:13
computerpublic6-Mar-14 6:13 
GeneralRe: System.ArgumentOutOfRangeException: Index was out of range Pin
Richard Deeming6-Mar-14 6:47
mveRichard Deeming6-Mar-14 6:47 
GeneralRe: System.ArgumentOutOfRangeException: Index was out of range Pin
computerpublic6-Mar-14 7:44
computerpublic6-Mar-14 7:44 
AnswerRe: System.ArgumentOutOfRangeException: Index was out of range Pin
BobJanova6-Mar-14 7:04
BobJanova6-Mar-14 7:04 
GeneralRe: System.ArgumentOutOfRangeException: Index was out of range Pin
computerpublic6-Mar-14 7:47
computerpublic6-Mar-14 7:47 
GeneralRe: System.ArgumentOutOfRangeException: Index was out of range Pin
computerpublic6-Mar-14 7:49
computerpublic6-Mar-14 7:49 
GeneralRe: System.ArgumentOutOfRangeException: Index was out of range Pin
Richard Deeming6-Mar-14 8:06
mveRichard Deeming6-Mar-14 8:06 
GeneralRe: System.ArgumentOutOfRangeException: Index was out of range Pin
BobJanova6-Mar-14 23:05
BobJanova6-Mar-14 23:05 
Questionupdate command in sqladapter Pin
Moneyzz Sharma6-Mar-14 4:04
Moneyzz Sharma6-Mar-14 4:04 
AnswerRe: update command in sqladapter Pin
OriginalGriff6-Mar-14 4:39
mveOriginalGriff6-Mar-14 4:39 
SuggestionRe: update command in sqladapter Pin
Richard Deeming6-Mar-14 5:05
mveRichard Deeming6-Mar-14 5:05 
GeneralRe: update command in sqladapter Pin
OriginalGriff6-Mar-14 5:10
mveOriginalGriff6-Mar-14 5:10 
QuestionRe: update command in sqladapter Pin
Moneyzz Sharma6-Mar-14 5:35
Moneyzz Sharma6-Mar-14 5:35 

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.