|
1)how can i copy all element of 1 dataset to another dataset
2)i have an datagride in my form and it has a virtual dataset , how can i update this dataset
########################
|
|
|
|
|
Just using Copy() method
Dataset ds=new DataSet();
Dataset dsExisting=new DataSet();
ds=dsExisting.Copy();
For assigning to a datagrid
say datagrid1.DataSource=ds;
bye
|
|
|
|
|
Dear all,
Please let me know how to capture the screen of the other systems which are under LAN from my system.
|
|
|
|
|
You have to install a program on each system that can capture the screen and send it to your system.
---
b { font-weight: normal; }
|
|
|
|
|
Hello
I have an abstract class and a second class that inherits.
My question is.
Which class executes first when I do this in the constructor
public void NoAbstractClassConstructor(): base();
I have several methods in the abstract class and i would like to know if they executes first.
Thanks in advance
Jose
|
|
|
|
|
Pepito Fernandez wrote:
Which class executes first
Huh? If you wanted to know the order of execution of constructors, then the base class constructor executes first before the derived class's. Not 100%[^] true, because field initializers run before the base class constructor is called, but you can safely assume it is true for most cases.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi friends,
I want to access all members of Color enum one by one . any one can help me?
|
|
|
|
|
You are looking for Enum.GetNames[^]. Pass any enum type as a parameter and it returns a n array of strings containing the names of the enum elements. In your case, you need to call it as Enum.GetNames(typeof(Color)); .
Hope this helps.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
How can I Draw a string in reverse color of background?It is easy using code like this
private void tb_Paint(object sender, PaintEventArgs e)<br />
{<br />
string text = ((TouchButton)sender).strName;<br />
FontFamily fontFamily = new FontFamily("Times New Roman");<br />
Font font = new Font(fontFamily,12,FontStyle.Bold,GraphicsUnit.Point);<br />
Rectangle rect = new Rectangle(this.iHorizentalSpacing ,<br />
this.iVerticalSpacing , this.iWidth - 2 * this.iHorizentalSpacing<br />
, this.iHeight - 2 * this.iVerticalSpacing);<br />
e.Graphics.FillRectangle(Brushes.Black,rect);<br />
e.Graphics.DrawString(text,font,Brushes.White,rect);<br />
}
but I Want to generate colors and they reverses manually.
Ali Beirami
|
|
|
|
|
Does negating the hex value of the background color work? Something like
Color bgColor = Color.Black;
g.FillRectangle(new SolidBrush(bgColor), 0, 0, this.Width, this.Height);
int val = bgColor.ToArgb();
val = ~val;
Color foreColor = Color.FromArgb((0x000000FF & (val >> 16)), (0x000000FF & (val >> 8)) , (0x000000FF & (val)));
g.FillRectangle(new SolidBrush(foreColor), 0, 0, 100, 100);
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Dear All,
There is a squid server on WinXP (127.0.0.1:8081).
I have a C# application that I want to it redirect ALL HTTP request to squid(transparent proxy).
(application and squid run on same system)
I use GlobalProxySelection and below code in my application, but dont work.
Uri proxyURI = new Uri("http://127.0.0.1:8081");
GlobalProxySelection.Select = new WebProxy(proxyURI);
How can I redirect ALL http request to this proxy server?
Is correct this question!? Can I do it on windows OS?
--TNX
|
|
|
|
|
I have this problem too.
Can everybody help us?
|
|
|
|
|
If you are running a transparent proxy, you dont need to change anything on the clients. The proxy get automatically used for outgoing requests to port 80 as directed by iptables in linux. You can verify this by inspecting the http repsonse headers. Squid should add 1 or 2 headers to the response. If your are using this for webservices you mite wanna disable caching on the webservice else your requests will be cached by squid.
xacc-ide 0.0.99-preview
|
|
|
|
|
No, I want to run a transparent proxy that redirect all http packets to caqche server.
How can I do it?
|
|
|
|
|
Hi
I want to redirect all my network traffic especially UDP through proxy server. I want to change contents of some of my packets and then send that packet to the destination. Any idea how I can do this. I am not good in C, any solutions in C# will be a plus as I have to complete it early.
|
|
|
|
|
Hi,
I'm having some trouble with random numbers.
I'm building a BTree structure but wether the node I'm inserting goes left or right needs to be random.
The problem is that:
Random rand = new Random();
int num = rand.Next(1,3);
always produces the same number everytime time the function is called.
I tried generating 2000 numbers in a list and found that about 1/3 were 2, the next 1/3 were 1 and the next 1/3 were 2.
Basically the default seed is the current time's Millisecond property.
I tried setting my own seed and had the same results.
If I do System.Threading.Thread.Sleep(1000) I get what looks like a valid set of random numbers.
The problems is I can't wait for 1 second per Random number as I need to make thousands of these decisions in a short space of time.
Is there a seed I can provide, mayve a smaller number than Millisecond?
I was thinking of having an array of seeds, and everytime I need a random numbr, then choose the next seed in the list, and add it to the current time.
This way, even when the same element of the array is selected when it loops around the seed will be different.
The problem is I really couldn't be bothered coming up with thousands of numbers for this.
Is there an easier way?
Thanks,
Stephen York
|
|
|
|
|
How silly can I be?
I was creating a new Random object every time I needed a new number.
I took the declaration out and declared it globally and assigned it in my class's constructor.
Please ignore my silliness.
|
|
|
|
|
|
I have loaded and image into an imagelist. Now how can I convert this into a System.Drawing.Icon so that I can use it as an icon.
|
|
|
|
|
Do you actually want it output as a .ico file or just for use in your application ?
|
|
|
|
|
Here is a function which could run for a while.
So I put it into a thread.
Now I want get the result as soon as it returns.
How to do it?
Thanks!
|
|
|
|
|
The thread function can't return a value, because you don't know when it will complete. The only way is to share a variable and make the thread signal to the original thread when it has completed updating the variable.
class Test
{
int val = 0;
AutoResetEvent evt = new AutoResetEvent(false);
void MainThread()
{
new Thread(new ThreadStart(ThreadFunc)).Start();
evt.WaitOne();
Console.WriteLine(val);
}
void ThreadFunc()
{
Thread.Sleep(2000);
val = 1000;
evt.Set();
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Every time I new a TcpClient , it takes me almost 30 seconds.
Is it too slowly?
Is there any way to increase the speed?
Thanks a lot!
|
|
|
|
|
Hi,
do you know if there is an exam available for windows c# 2.0 ?
Thanks
|
|
|
|
|