|
justeena.paul wrote: Please send me an answer
answer
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
justeena.paul wrote: Please send me an answer.
The squaw on the Hippopotamus.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
How large is your data set?
|
|
|
|
|
|
So what's your problem?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
hi
In windows application I am using a button and serial port
in button the control is like a power ON/OFF switch which should change the color if its clicked. ie., when first click is ON the color is red and second click OFF Blue.
And it should send a value to serial port for ON "A", For OFF "a".
i need the code. for above application
|
|
|
|
|
so have a bool assign to false.
then in your button click...
isOn = !isOn;
if(isOn)
{
button.BackColor = Color.Red;
}
else
{
button.BackColor = Color.Blue;
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Use Green color. It would be as per the standards.
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Mads115 wrote: i need the code. for above application
Start typing - we help, we tutor, we suggest research lines, we don't do your work for you!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello Friends
I need to get the value of the cell of my grid. I mean suppose if I click on the cell which is is on 3rd row and 2nd column then I'll get the value of that cell or how can I hold that cell? And I'm using Devexpress grid control.
Any help would be appreciated.
Thanking in advance
Johnny
|
|
|
|
|
I don't use DevEx controls but there must be an event fired when you click on a cell, part of the event will be the e arguments, inspect them and you will almost certainly find a reference to the cell, column and row of the clicked cell.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello fellow DevXian...
I understand your pain. I love DevX, but learning all of the new functions can be a bit overwhelming. Too bad they don't have better on-line help.
Anyway, I believe the function you are looking for is [YourGridView].GetFocusedRowCellValue(). You'll have to supply a GridColumn or the field name as a string for the column of interest.
Hope that helps. You can also try searching their on-line help at www.devexpress.com/Support/Center[^]
-NP
Never underestimate the creativity of the end-user.
|
|
|
|
|
Who knows How to Split data by Fixed length
|
|
|
|
|
what exactly do you mean?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I mean if I have text file like this
==lo12365=12/08/05 12.30 lo op
==lo12589=13/08/04 12.15 li oo
==lo89099=18/05/09 12.10 io io
How to read in C#
Someone said I should use split and Format = fixed Length
But I don't know how ????
|
|
|
|
|
if you want to read a file you a System.IO.StreamReader which has functions such as ReadLine();
Each time you call ReadLine();
it will return a string of the next line in the file, until null (end of file).
You can then do what you want with that string. If you need dates and times seperate you will prob want to use String.Split() method.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Yeppp I've knowed how to read
I use
using System.IO;
namespace WindowsApplication23
{
public partial class Form1 : Form
{
OpenFileDialog o;
FileInfo info;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
o = new OpenFileDialog();
if (o.ShowDialog() == DialogResult.OK)
{
info = new FileInfo(o.FileName);
label1.Text = info.ToString();
}
}
private void button2_Click(object sender, EventArgs e)
{
StreamReader reader = info.OpenText();
textBox1.Text = reader.ReadToEnd().ToString();
reader.Close();
}
}
}
but it read all of my file I just want it
from
==lo12365=12/08/05 12.30 lo op
==lo12589=13/08/04 12.15 li oo
==lo89099=18/05/09 12.10 io io
tobe
lo12365 12/08/05 12.30 lo op
lo12589 13/08/04 12.15 li oo
lo89099 18/05/09 12.10 io io
and insert it to my table
thx in advance
|
|
|
|
|
Well as i suggested use ReadLine() you are using ReadToEnd() which is not what you want.
in you button2_Click...
StreamReader reader = new StreamReader(info.Filname);
string line = reader.ReadLine();
while(line!= null)
{
string newLine = line.Replace("=", " ");
string[] vals = newLine.Split(' ');
line = reader.ReadLine();
}
reader.Close();
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
It has error on
StreamReader reader = new StreamReader(info.Filname);
can I change it to b
StreamReader reader = new StreamReader(o.FileName);
and it can't run on Button2
I don't know why
|
|
|
|
|
yes you can change it to that. The parameter is just the full path of the file.
And why cant it work it buttonClick? you get error message? You can put the code anywhere. you decide where is best for you
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I don't know why
I add
string line = reader.ReadLine();
while (line != null)
{
string newLine = line.Replace("=", " ");
string[] vals = newLine.Split(' ');
line = reader.ReadLine();
}
<big> textBox4.Text = reader.ReadLine();</big>
reader.Close();
and then when I click in button 2 it 's nothing
but button 1 can use
Thank in advance
|
|
|
|
|
well i would guess you problem is you have not assigned the event handler to button2.
Go in design view, select button2, go to the events tab on the right and make sure 'Click' has been set to the handler.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Yepp I've done it but It still can't run
The first I assign
textBox4.Text = reader.ReadLine.ToString();
but it said I used wrong method
so I change it to be
textBox4.Text = reader.ReadLine.();
It's no error
but can't use
I don't know why TwT
Message when it error
http://www.uppicth.com/show.php?filex=e5d4b8cd0fec144f140ded8bcbcfe23a.JPG[^]
modified on Thursday, April 30, 2009 6:15 AM
|
|
|
|
|
should be textBox4.Text = reader.ReadLine();
where are you using that thou? are you sure your not reading a null value?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
If you look closely at the code segement you posted:
yueru wrote:
string line = reader.ReadLine();
while (line != null)
{
string newLine = line.Replace("=", " ");
string[] vals = newLine.Split(' ');
line = reader.ReadLine();
}
textBox4.Text = reader.ReadLine();
reader.Close();
The problem becomes obvious, no?
When does it exit from the while loop?
How much of the file is left to be read into textBox4?
If you still can't see it, run it slowly through the debugger (sorry Luc) and it should be crystal clear.
Before you ask, no I won't correct your code. This is a basic error and you will learn better finding it yourself - you have all the clues and tools you need.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|