|
In your case, you can create Method like you had before.
private void get_DataGridRows(...... ;
just insert code in your Method.
Martin
Please give me feedback, if it works.
|
|
|
|
|
Again, it was code from my project.
|
|
|
|
|
Ok let me try out.
I need to leave for the day now.
Catch you tomorrow..
Thank you very much for your suggestion and time.
Regards,
Kais
|
|
|
|
|
hi Martin,
In meanwhile is it possible for you to send me the complete sample code.
I would be very greatful for you if i can get the sample code.
Thanks for all your help
Regards
Kais
|
|
|
|
|
Hello All,
We are using a third parties VB6 object resource file with icons, bitmaps, and text. Ours is completely C# and we are having trouble converting from stdole.stdpicture to C# Image. In VB6 we can access everything fine. In C# we can get the text and the bitmap to convert perfectly but the icons are giving us trouble. The VB method returns a stdpicture object and we use the System.Windows.Forms.AxHost.GetPictureFromIPicture perfectly with the bitmap but we get an error with the icons. Even though the vb method returns a stdpicture C# sees it as an icon and I know of no equivalent to GetPictureFromIPicture for icons. The error is "Unable to cast object of type 'System.Drawing.Icon' to type 'System.Drawing.Image'."
Any way around this would be greatly appreciated.
|
|
|
|
|
After using Google to search for "Converting System.Drawing.Icon to System.Drawing.Image" I found this link in about 2 minutes.
Microsoft Article[^]
It is MS -- so it is VB crap. But it should get you started.
|
|
|
|
|
I guess I wasn't clear. This is exactly what we are trying but the incoming Ipicture is seen in VS2005 as an Icon and bombs when you reach the GetPictureFromIPicture with the error mentioned originally. The one difference we are doing from the samples like the one you provided is we are using stdole.StdPicture as that is what the vb object returns so we can't use stdole.IPictureDisp. I am currently writing a quick project in 2003 to see if it is a VS2005 bug. Our other thought is to write a vb object that takes the stdPicture from the 3rd party dll turn it into something else then pass it along to C#. What a pain though.
|
|
|
|
|
How to subtract 7 days from current date in c#.
Prya
|
|
|
|
|
Use TimeSpan class
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
DateTime curDate = DateTime.Now;
TimeSpan DaysSpan= new TimeSpan(7, 0, 0, 0);
DateTime resultDate = curDate.Subtract(DaysSpan);
Test ONE
|
|
|
|
|
DateTime sevendaysago = DateTime.Now.AddDays(-7);
|
|
|
|
|
See following :
http://pinvoke.net/default.aspx/kernel32.SetLocalTime
|
|
|
|
|
So this is probably a dumb question, but I'm new to network programming and just trying to figure out all the details...
I've been messing around with settings up a Server/Client application, using the TcpClient and TcpListener objects. These are nice and easy, but how do I communicate outside of my local network? For instance, how do I start a server on a computer on my network with a router assigned address (ie. 192.168.X.XXX) and have someone else connect to it from another location? I can't just give them the 192.168.X.XXX address to type in for their TcpClient... so how do I establish a connection, or can I? Do I just need to have a server that isn't connected to the internet by a router?
Basically I want to so something similar to what a game server would do... start up a game and act as the server, have people connect to it, transfer some data, then shut everything down. Is there just another way to obtain an address that will properly resolve to my server if it's on a router?
Thanks in advance...
|
|
|
|
|
You must use port forwarding in the router. Just set port forwarding to IP 192.168.X.XXX and enter the port number you want (intern and extern).
|
|
|
|
|
Hey thanks... that was the missing piece! Direct and helpful. Now I know...
|
|
|
|
|
Has anyone done this with C# before?
|
|
|
|
|
devfendar wrote: Has anyone done this with C# before?
Replicate what?
|
|
|
|
|
What do you mean here ?
If you're asking about creating a copy of the existing object - have a look at the IClonable interface.
Best regards,
-----------
Igor Sukhovhttp://sukhov.net
|
|
|
|
|
|
I found a quine by Peter Gfader[^], that I of course had to improve upon...
using System; class MainApp { public static void Main() { char q=(char)34;string var=System.Text.Encoding.ASCII.GetString(new byte[]{115,116,114,105,110,103,32,98,61});char s=';';string a="using System; class MainApp { public static void Main() { char q=(char)34;string var=System.Text.Encoding.ASCII.GetString(new byte[]{115,116,114,105,110,103,32,98,61});char s=';';string a=";string b="Console.WriteLine(a+q+a+q+s+var+q+b+q+s+b); } }";Console.WriteLine(a+q+a+q+s+var+q+b+q+s+b); } }
---
b { font-weight: normal; }
|
|
|
|
|
public class MyClass : ICloneable
{
public object Clone()
{
return (object)this;
}
}
|
|
|
|
|
hI,
I have a web page in which i am generating all the controls dynamically .I have a place holder(also dynamically generated)in webform1 into which i am pushing all the All the generated controls .
Now i want ato inherit this page into webform2 .What i tried was
public class Webform2 : webform1
in webform class i have a ftion
public void look()
{
// Response.Write("look");
PlaceHolder pl = new PlaceHolder();
TextBox tb;
tb = new TextBox();
tb.Text = "adarsh";
tb.Visible = true;
tb.Width = Unit.Percentage(20);
tb.Height = Unit.Percentage(20);
pl.Controls.Add(tb);
this.form1.Controls.Add(pl);
}
}
in webform2 class i call page load event i call this ftion look .But it gives a runtime exception saying in line this.form1.Controls.Add(pl); object reference not set to an instance of an object.Why is this and pls suggest any solution for this.
-- modified at 1:54 Monday 3rd July, 2006
|
|
|
|
|
i had barcode but please help me to use it in my project
i dont how to use it which control would help me to use it and and how how to use what it read
|
|
|
|
|
omar el halwagy wrote: i had barcode but please help me to use it in my project
i dont how to use it which control would help me to use it and and how how to use what it read
You had it and now you don't? Don't quite understand your question. If you're looking for a barcode control, go here[^] and hope this can help you out.
|
|
|
|
|
not abl 2 understand ur question. anyway i assume that U have barcode scanner u want to read the barcode display it in some boxes. right?? for that there is no spl controls. place cursor in the textbox and scan the barcode using barcode scanner now the barcode will be displayed in textbox. if my assumption is correct the answer is correct.
|
|
|
|