473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Read Null values from text file

Hello !

In c# , I am reading values from text files , when I try to get the value
from the text file and nothing is written there (Null - I think) , I get
Error message
{"Index was outside the bounds of the array." }.

How can I check if no value is written before I try to access the value?

Thanks !

May 17 '06 #1
2 1282
> when I try to get the value
from the text file and nothing is written there (Null - I think) , I get
Error message
{"Index was outside the bounds of the array." }.
What array? You didn't mention anything about any array.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:07**********************************@microsof t.com... Hello !

In c# , I am reading values from text files , when I try to get the value
from the text file and nothing is written there (Null - I think) , I get
Error message
{"Index was outside the bounds of the array." }.

How can I check if no value is written before I try to access the value?

Thanks !

May 17 '06 #2
Kevin ,
Thank U for your response!
I have already solve it with this line:

this.yourtextbox.Text.Length != 0

"Kevin Spencer" wrote:
when I try to get the value
from the text file and nothing is written there (Null - I think) , I get
Error message
{"Index was outside the bounds of the array." }.


What array? You didn't mention anything about any array.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Niron kag" <Ni******@discussions.microsoft.com> wrote in message
news:07**********************************@microsof t.com...
Hello !

In c# , I am reading values from text files , when I try to get the value
from the text file and nothing is written there (Null - I think) , I get
Error message
{"Index was outside the bounds of the array." }.

How can I check if no value is written before I try to access the value?

Thanks !


May 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
6
by: Ruben | last post by:
Hello. I am trying to read a small text file using the readline statement. I can only read the first 2 records from the file. It stops at the blank lines or at lines with only spaces. I have a...
1
by: Magix | last post by:
Hi, I have these string data: str_data1, str_data2, str_data3, which capture some value after a routine process A. Then I would like to write (append) these 3 string values into a text file each...
7
by: Naren | last post by:
Hello All, Can any one help me in this file read problem. #include <stdio.h> int main() {
8
by: james | last post by:
I am trying to use Filestream to read a file ( .DAT) that contains values in HEX that I want to convert to text. I know the different offset addresses for each portion of the data I am trying to...
4
by: Antonio Tirado | last post by:
Hi, I'm using the OleDB namespace to open a CSV File. I can read the file sucessfully except for hyphenated values. My CSV File contains phone numbers and sometimes these come separated with...
9
by: Adi | last post by:
Hello eveyone, I wanna ask a very simple question here (as it was quite disturbing me for a long time.) My problem is to read a file line by line. I've tried following implementations but still...
9
by: srikanth | last post by:
i have a text file like below, test.txt file (actually my test file file is with 10000 lines but here i tested with 3 lines) 3 06.09.2006 16:37:25 3 06.09.2006 16:40:02 3 06.09.2006 16:42:31...
13
by: rohit | last post by:
Hi All, I am new to C language.I want to read integers from a text file and want to do some operation in the main program.To be more specific I need to multiply each of these integers with another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.