|
SABhatti wrote: looking for way to connect to idx files using username and password,
Since you didn't specify I am guessing you mean the Database username and password, is that correct?
If so, in your last post you said this:
SABhatti wrote: instead of getting it from the actual db server.
So you want to get it without using the database server by using the database server, is that about it?
|
|
|
|
|
I think the problem is that Mike knows that the OP doesn't know. You know?
It's like trying to open an Access database without the Jet Database Engine installed. Good luck with that...
|
|
|
|
|
-----
|
|
|
|
|
let me give u some detail, you might have an idea that some companies develop the page, an activeX, and made a CD along with a .dat and .idx file. Now the end users install the application on their machines, use that page to validate some data e.g. some company name against the CD, the page uses the activeX control to validate information entered by the user against the idx file on the CD and show results, if any, on the page. All this is done through the activeX control which reads from the idx file on the CD. I want to know how to validate/read the information from the IDX file? hope you understand my question now.
-----
|
|
|
|
|
I am working with Visual Studio 2005 in C#. I would like to programatically create Word documents. That is, I would like to access the Word object model.
Can I do that with VS 2005? I am reading something about Visual Studio Tools for Office. Do I need that? Or can I just use VS 2005.
Are there class libraries I need to obtain?
Thanks,
Mark
|
|
|
|
|
I could be wrong here, but I don't think you need VSTFO to work with office and VS 2005. Just make a reference to the Word object library and go to town.
|
|
|
|
|
You are write, you just need to add reference to the Word Object Library.
|
|
|
|
|
Hi,
A datagridview is re-populated from a datatable every so often, i.e. every 10 seconds. I am using a timer to trigger the re-population.
Now I would like to move a step forward by checking which cells have changed.
I would like to know which cell(s) have changed so that particular cell gets a new colour for a few moments.
For example if the data in column 5, row 2 has changed then that cell changes colour for a few seconds and the same for any other changed cells.
This is basically a realtime application to show the changes as they happen.
How does the datagridview allow for such a task?
Thanks
|
|
|
|
|
I think so DataGridView doesn't have something like this. Maybe you will have to implement it...
Visit my blog at http://dotnetforeveryone.blogspot.com
|
|
|
|
|
I know of no built-in functions that would perform what you are describing.
One thing I'm thinking is that you make a copy of the DataTable DataGridViewRowCollection belinging to your DataGridView or before you perform your update. After the update, run through every cell in the new table or collection and compare that with the old one. If it's the same, change the color of the appropriate cell. To save on processes, you restrict your comparison to only the visible rows by using the FirstDisplayedScrollingRowIndex property.
|
|
|
|
|
Hi everybody.
I'am working in a web page and I want to open a save as dialog box when the client click on the download botton, and, obviously, download a file to the path that he desired.
I need to capture the path where he want to save the file? I do this from the save as dialog box that I don't now make it?
FYI, i cant use system.windows.form in the web. that's OK?
thanks a lot.
caradri.
|
|
|
|
|
SaveFileDialog dlg = new SaveFileDialog();
if (DialogResult.OK == dlg.ShowDialog())
{
MessageBox.Show(dlg.FileName);
}
That will display a basic
SaveFileDialog<code> and when the user saves the file, it will display the full path to the file. You shoulld be able to figure out how to change all the different bells and whistles from there. <br />
<br />
<div class="ForumSig">"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer <br />
<br />
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")</div>
|
|
|
|
|
Justin Perez wrote: SaveFileDialog dlg = new SaveFileDialog(); if (DialogResult.OK == dlg.ShowDialog()) { MessageBox.Show(dlg.FileName); }
He is asking about in a web application on a web browser. This wouldn't work in that case.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Vasudevan Deepak Kumar wrote: He is asking about in a web application on a web browser. This wouldn't work in that case.
Ah. Didn't see that
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
caradri wrote: I'am working in a web page and I want to open a save as dialog box when the client click on the download botton, and, obviously, download a file to the path that he desired.
Check out this http://support.microsoft.com/kb/260519[^]
caradri wrote: I need to capture the path where he want to save the file? I do this from the save as dialog box that I don't now make it?
You can not do this and you need not. The file saving would be handled by the web browser itself.
caradri wrote: cant use system.windows.form in the web. that's OK
That's correct.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Hi,
how can I call static method on a Type variable, when following is known:
- there is a Class 'A', which implements a static method - public static int GetValue().
- there may by several subclasses 'B, C ,D ,E' where all of them derive from A , so they all derive GetValue() method.
- some of subclasses may want to override GetValue() ( declare public new static int GetValue()) and return different value than parent class ('A') returns.
now, I have a variable of type Type :
Type myType;
and I know that myType contains one of subclasses of A class.
how can I call static GetValue() on myType (withount instantiating it!!!)
I hope it's not confusing )
thanx
zilo
|
|
|
|
|
MethodInfo inf = myType.GetMethod("GetValue");
inf.Invoke(null, new object[] parameters );
if it's static it will ignore the first parameter (null);
|
|
|
|
|
thanx
that's what I used, but I (am) was curious if there is a "nicer" way how to do that.
zilo
|
|
|
|
|
Well, guess you could use generics too, if reflection isn't nice enough for you (although that's not necessarily better way to do)
|
|
|
|
|
ok, it works, but the thing is, that when GetValue is not overridden in subclass, reflection doesn't return parent method but null. And when I think about it, it's probably better that way. I can call parent method anyway...
zilo
|
|
|
|
|
Guess it's better with generics then, cuz you don't have to worry about wether it overrides or just inherits.
|
|
|
|
|
Can you be more specific how to do that with generics?
Anyway , I can't use generics, cause that method is a part of a control (Form) and there is a bug regarding Designer and generics. It would not display child classes (Forms) in Designer at all. It's bug by design...
zilo
|
|
|
|
|
Involved not changing return types. Another option is to create a generic method.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Hi All,
I'm attempting to test if a high bit is set on a octet. C# is stating:
An unhandled exception of type 'System.OverflowException' occurred in mscorlib.dll
Additional information: Value was either too large or too small for an unsigned byte. Any ideas how to work with bit values in C# without losing semantics (readability)? At this point, I'd also take something that works as expected (or works as I expect).
Jeff
ArrayList Octets = new ArrayList();
...
Int32 i=0;
while( i < Octets.Count )
{
Byte b = Byte.Parse(Octets[i].ToString());
b &= unchecked(Convert.ToByte(~0x80));
if( 0x00 == b ) { break; }
....
i++;
}
|
|
|
|
|
Hi Jeffrey,
I am not sure what type it is you originally put into the ArrayList, I will assume the
item type is byte.
Here are some ideas:
- I see no point in using Parse(...ToString()), that is turning a number to a string to
get a number again. why not treat the ArrayList item directly? Of course ArrayList only
returns type object, so you would have to cast to the original type, as in
(byte)Octets[i]
- in general, bit manipulations are easiest on unsigned numbers, so byte is OK
- your problem statement is not doing what you intend: ANDing with the complement of 0x80
is ANDing with 0x7F, that is stripping off the highest bit; a subsequent zero-test will
return true iff the original value was either 0x00 or 0x80.
- testing any bit can be achieved by ANDing and comparing to zero; testing the highest bit
would require something like: if ((b & bMSB)!=0) MSB_is_set; else MSB_is_clear;
where bMSB could be a byte variable initialized to 0x80u (u suffix for unsigned).
- you can use foreach instead of for to iterate over a collection. It does not need
an index variable, you can and must specify both the type and the name of the object itself
you are getting from the collection; as a bonus you don't need to cast the ArrayList
element anymore.
So this is what I would suggest:
byte bMSB=0x80u;
ArrayList Octets = new ArrayList();
...
foreach (byte b in Octets) {
if((b & bMSB)!=0) break;
....
}
Furthermore, you could use a generic collection (available since .NET 2.0), in this case
a List<byte> instead of an ArrayList, although the difference would be minor here.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|