|
I was thinking the same thing, but...
I can't close the datareader as I still need it.
I tried making a new SqlCommand in a different variable, but this didn't solve the problem.
I now have two connections wich I don't realy want.
|
|
|
|
|
Hello
Jonathan van de Veen wrote: I now have two connections wich I don't realy want.
Sorry! It's not a perfect world!
Regards
|
|
|
|
|
Oh, I guess I took a wrong turn near Mars somewhere.
|
|
|
|
|
Hi All!
if my Program is running, and i create a messageBox that apears if there is a change in the prohramm, to get the first Focus of all the tasks, i mean if i run an application and then i open a web page and then there is the messageBox creation, how can i do that it will pop up in front of the web page or visualy, or any other application that is running in the background.
Thanks.
Do i need to activate the Focus function on the Form(My programm) and then create the messageBox?
|
|
|
|
|
I guess this is really more of a JavaScript question then a C# question, but you could try to call Window.focus(); in Javascript.
|
|
|
|
|
I am sorry, you got it all wrong, when i gave the web application i ment a task that is running in the forground and that my Form is running in the background or minimized.
So i mean in a Winapplication not javascript
|
|
|
|
|
|
i want to make sql statment that use mod % Div /
i have tow colum
tt | time
---------
1 | 1
2 | 2
3 | 9
i want to make list for all record if (time % 5 = 0)
* how can make this
Palestine
|
|
|
|
|
you could make this by typing the query and executing it.
the query has to be written according to your database rules (most likely sql 92 standard).
the modulus operator is available too (and its the %-char).
as a special hint: use the where clause (where x % 5 = 0)...
|
|
|
|
|
select * from [TableName] where time % 5 = 0
Kind Regards,
John Petersen
|
|
|
|
|
Hi,
I have created a windows service (in vs.net 2005 for windows 2000 pro) and set the startup type to automatic.
But when I reboot my computer, I have to restart the service manually.
Does somebody know what the problem is here???
Thanx
|
|
|
|
|
Could this be a setting in one of the standard service objects?
|
|
|
|
|
Hi!
Must have something to do with your code, for example: Your service _is_ being started automatically, but shuts down afterwards.
But without code it's impossible to say...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thanks to everyone for looking at my problem, but I found a solution.
Because my computer is not one of the fastest, I had to set the ServicesPipeTimeout to 60000 (standard value 30000) and create a dependency on the Eventlog service for my windows service.
Thanx!
Tom
|
|
|
|
|
Hi,
i need something similar to a pointer in C#. C# itself has pointers implemented but they do not fit my needs.
I want to "map" a Variable to another one, in two different objects of a different class.
Pointing to a variable of a "user-defined" type is not a problem but pointing to a "managed" type is. It doesn't let me point to strins, integers or other built-in datatypes.
Thats why pointers do not work in my case - do you know any workaround for making the pointers work as i want them to or do you know another possibility to realize this?
Here is a little example of what i want to be able to do:
<br />
class MyClass<br />
{<br />
public int AValue = null;<br />
}<br />
<br />
class AnotherClass<br />
{<br />
public int * APointerToAValue = null;<br />
<br />
public AnotherClass(ref int MappingVar)<br />
{<br />
unsafe<br />
{<br />
fixed (int * tmpptr = &MappingVar)<br />
{<br />
APointerToAValue = tmpptr;<br />
}<br />
}<br />
}<br />
}<br />
Now when executing the following code
<br />
MyClass MyObj = new MyClass();<br />
AnotherClass AnotherObj = new AnotherClass(ref MyObj.AValue);<br />
<br />
AnotherObj.APointerToAValue = 3<br />
Console.WriteLine("Pointer: " + AnotherObj.APointerToAValue.ToString());<br />
Console.WriteLine("Value: " + MyObj.AValue.ToString());<br />
<br />
MyObj.AValue = 4<br />
Console.WriteLine("Pointer: " + AnotherObj.APointerToAValue.ToString());<br />
Console.WriteLine("Value: " + MyObj.AValue.ToString());<br />
this result should be produced:
<br />
Pointer: 3<br />
Value: 3<br />
Pointer: 4<br />
Value: 4<br />
Is there any way to manage it like this in C#? It doesn't has to be realized with pointers at all i just need a solution for the given problem!
|
|
|
|
|
You can not access the member of the class directly (unless resorting to reflection), but you can use a propery to transparently access the member via the object:
class AnotherClass {
private MyClass theOther;
public AnotherClass(MyClass theOther) {
this.theOther = theOther;
}
public int TheValue {
get { return this.theOther.AValue; }
set { this.theOther.AValue = value; }
}
}
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for replying.
The situation is a bit more complicated than i told you that's why it won't be solvable this way. I don't know the variable which will be "mapped". So in the first example i used "ref AValue" as parameter for AnotherClasses constructor. In fact, AValue could be MyValue, HisValue or AnyonesValue - i don't know it before calling the constructor at runtime.
The "TheValue"-property would have to return the variable, which was permitted to the constructor. At this point i will need pointers again.
As already said, thank you for you reply but i couldn't solve the problem by now
|
|
|
|
|
Then you have to rethink the entire problem. You can't use pointers in that way in a platform that uses a garbage collected heap. You would have to pin the object that you are pointing into at the current memory location, which will badly cripple the whole garbage collecting process as long as it is pinned.
---
b { font-weight: normal; }
|
|
|
|
|
how to add row and delete row geting data from txtboxes to Janus GridEx (Grid)
sikandar
|
|
|
|
|
|
In C#, I want to write a method to determined if astring contains any UniCode character( a character belong UniCode but not in Utf8, such as a japanese character or chinese character ), How can I do it? Please help me.
Thanks.
-- modified at 3:21 Monday 4th September, 2006
|
|
|
|
|
UTF-8 is an encoding of Unicode, so any Uncode character can be stored in UTF-8.
I don't know exactly what you want to find out, but perhaps the Char.IsSurrogate method is something that you are looking for.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you.
I find the Char.isSurrogate() always return false, such as Char.isSurrogate('a'),Char.isSurrogate('10') all return false.
but it give me the right way, and I read the topic of Char class,
and find follow code can answer my question:
Char.GetUnicodeCategory(char1)==System.Globalization.UnicodeCategory.OtherLetter
when char1 is a Eastern character, it return true.
|
|
|
|
|
hi guys!
need some help!
i m developing a Enterprise deployment Application which will install software on network from a remote machine..
for this i m using WMI "Win32_Product" class for remote installation
the code is working fine on Win 2000,XP home, XP pro, XP sp1,sp2 .. but gives an Invalid class Exception on win 2003 ..
the problem is "WMI Windows Installer Provider" component which is installed by default on all the above OS except WIN 2003, on this OS it is Optional and had to be installed mannually on each of this kind of OS ..
the Problem is I want this Component also to be installed Remotly on PC's having 2k3 by my application only.. of course i have admin rights on all network PC's
Any ideas how to install this component Programmatically..
any guideline.. will be a great help..
also where can i find the Setup for this as it is a windows component..
abhinav
|
|
|
|
|
How can I have a PrintScreen Of current page in the clipboard
( for Example when some event occur the print screen of the page copy to clipboard)
WITH.THANKS
MHF
|
|
|
|