|
I think you might want to try sheet.Cells(12,12).Value (and then maybe .ToString() )
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Hello Everybody,
I am developing a windows application using c#. I want access some .DBF
file without ODBC.
Can anybody help me out.
Thanks in advance.
|
|
|
|
|
cn0574 wrote:
I want access some .DBF
file without ODBC.
Without ODBC? I think, even ADO internally makes ODBC calls.
Do you mean to say you want to directly open the dbf file and parse it on your own? It might not be an elementary process at all. I suggest that you use OLE DB .NET [underlying technology used by ADO .NET]
Regards
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I hope that a control can direct access .dbf file.
|
|
|
|
|
Does anyone know if it's possible to use assembly blocks in C#? Or any ideas on how to go about this?
andypat
|
|
|
|
|
Andy Patterson wrote:
Does anyone know if it's possible to use assembly blocks in C#? Or any ideas on how to go about this?
I don't think C# allows you asm blocks, but you can have asm blocks in your MC++ program and then access those classes from C#
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Yeah, thats what I thought. Thanks for your input.
andypat
|
|
|
|
|
I try to accomplish the simple task of writing an ASCII text file in C#/.NET
string str = "This\nIs\nA\nTest";
byte[] b = new byte[str.Length];
System.Text.Encoding.ASCII.GetBytes(str.ToCharArray(),
0, str.Length, b, 0);
FileStream TextFileStream = File.OpenWrite(FileName);
TextFileStream.Write(b, 0, str.Length);
I tried all kind of things like this.
or like that
FileStream TextFileStream = File.OpenWrite(FileName);
BinaryWriter BinaryASCII = new BinaryWriter(TextFileStream, System.Text.Encoding.ASCII);
BinaryASCII.Write(strText);
TextFileStream.Close();
But the newlines in my string never show up correctly in notepad.
What do I need to do do just simply write ASCII to a text file in C#/.NET ?
Tim
|
|
|
|
|
A newline is \n\r, or \r\n, I always forget which.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
if you just want to write text use the StremReader class it is meant for that
|
|
|
|
|
sorry for writing tex you need StreamWriter
|
|
|
|
|
or even TextWriter
James
Simplicity Rules!
|
|
|
|
|
See :-
http://www.codeproject.com/useritems/csfilestuff01.asp
[Shows how to read/write files using the reader/writer classes and also shows how to use the File class to get info regarding a file]
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
ok, thanks !
I'm a bit confused. Why do I need to write \r\n in C# but \n does fine it C++ ? Does fprintf etc automatically do this conversion since it knows that I'm writing ASCII ?
greetings,
Tim
|
|
|
|
|
Hi!
Has anyone an idea how i can get the cpu temperature with c#? I am going to develop a kind of hardware monitor.
Thx.
--== BINARY VICTORY ==--
|
|
|
|
|
There is a Win32_TemperatureProbe class in the WMI hierarchy that looks interesting, you can get to it via the System.Management namespace. I have never played with tracking down the CPU temp, so I could be off the mark here.
Regards
|
|
|
|
|
Scenario:
I have an object that has 2 overloads of a constructor. For some reason, overload1 in turn calls overload2.
i.e. I want to defer object creation until overload2 is eventually called.
I'm not sure of the syntax, as constructors don't seem to be treated as normal functions.
Can someone provide me with code for this?
Cheers,
Simon
"Every good work of software starts by scratching a developer's personal itch.", Eric S. Raymond
|
|
|
|
|
class Foo
{
int value;
public Foo()
: this(0)
{
}
public Foo(int i)
{
value = i;
}
}
|
|
|
|
|
Thanks, Neil. I'll pass this on to my team.
Is this a good practice (constructor calling constructor)?
Cheers,
Simon
"Every good work of software starts by scratching a developer's personal itch.", Eric S. Raymond
|
|
|
|
|
It’s more personal preference issue, although I don’t see how it could be a bad practice and in this case it is an integral part of the language. Code reuse (outside of cut and paste) is never a bad practice in my opinion.
Regards
|
|
|
|
|
Is there no additional overhead, in terms of MSIL code, to pull this off?
What about the alternative of creating an additional function that had the "shared" code that both constructors could use?
In your opinion, wouldn't this produce cleaner code?
Cheers,
Simon
"Every good work of software starts by scratching a developer's personal itch.", Eric S. Raymond
|
|
|
|
|
Again, its personal preference. In overhead terms, there really is nothing to pull off; the initial constructor does generate a call to the target constructor. If you were going to supply a common private initialization member, it may accomplish the same thing with or without parameter passing. If your initialization member is parameterized, I would venture a guess that it carries the same amount of overhead.
Regards
|
|
|
|
|
In terms of cleaner code, if the class carries a significant amount of initialization that is common across all constructors, yes a shared initialization member can be cleaner.
I have also seen cases where these initialization members also become a reset mechanism for the class. Not that this is a bad thing, but in large projects and/or as time goes on and maintenance coding kicks in, it may be easier for a member of your team to forget what the primary purpose of the member was and start calling virtual members within it, which is a bad thing.
My two cents.
Regards
|
|
|
|
|
When I owner-draw my ListBox with this code:
private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
{
e.DrawBackground();
ListBox listBox = (ListBox)sender;
bool selected = ((e.State & DrawItemState.Selected) == DrawItemState.Selected) ? true : false;
string displayText = listBox.Items[e.Index].ToString();
if(displayText.IndexOf("Sökresultat:") != -1)
{
if(selected == true)
{
e.Graphics.DrawString(displayText, new Font(this.Font, FontStyle.Bold), Brushes.White, e.Bounds);
}
else
{
e.Graphics.DrawString(displayText, new Font(this.Font, FontStyle.Bold), Brushes.Black, e.Bounds);
}
}
else
{
if(selected == true)
{
e.Graphics.DrawString(displayText, this.Font, Brushes.White, e.Bounds);
}
else
{
e.Graphics.DrawString(displayText, this.Font, Brushes.Black, e.Bounds);
}
}
}
When I add an item with a button the first item in the LisyBox will not be painted, when I click on it, it appears!"#?=`?=
What is wrong!!
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Hi Friends
I wrote a C# ADO.NET Application and deployed it in a another Machine,
I installed the .Net Framework and ado 2.7,C# client app is working but the Ado is not working. Error says it can't find the ADODB.DLL Assembly.
How to setup the ADO.Net?
Thanks
Gaurika..
Gaurika Wijeratne. // www.gaurika.com
|
|
|
|