|
protected override void OnStart(string[] args)
inside this i have an async sockect. That keep on waiting for client connect .Like
while (true)
{
Console.WriteLine("Waiting for a connection...");
}
When i start this service from computer Management it keeps on showing "Starting" but code works fine. What code be the problem I want the status to be "Started".
Regards
|
|
|
|
|
You shouldnt block the call to OnStart - it should return as quickly as possible.
|
|
|
|
|
Hello all,
I'm pretty new to C#, but I enjoy it very much. I have the following problem, that I can use some help with. I searched the net, MSDN forums, articles on here, but I can't seem to figure it out. I'm using C# Visual Studio 2005, which works slightly different then other editors I have used before.
What I'm trying to achieve is using a textbox value ( txtEditLoch ) as a filter in an SQL query. I created a dataset and I can add queries. One of my queries looks like this :
SELECT lochname, nmt_no, nmt_type, nmt_ph, nmt_loc, nmt_con_type, nmt_ip_address, nmt_comments
FROM nmt_info
WHERE (lochname = ' + this.txtEditLoch.Text + ')
This doesn't work. When I change the this.txtEditLoch.Text bit to an existing database value, it works perfect.
The textbox is populated with exactly with that same existing database value. I think I have got my query wrong. Can somebody please point me in the right direction.
Any help is much appreciated.
|
|
|
|
|
|
i need to know how to use the PrintDocument and the PrintDialog to print a specific file and specially a form.
thaks
jamil abou khalil
|
|
|
|
|
Hi all,
I need to convert the month number example 4 to "April"
i tried like this...
Convert.ToDateTime(cdata.Birthdate.ToShortDateString()).Month) but this brings back the number 4<br />
Convert.ToDateTime(cdata.birthdate.ToLongDateString()).Month) but this also brings back the number 4 not the word "April"
How do i go about converting the 4 into the month name?
Thank you in advance
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
DateTime.Now.ToString("MMMM")
Although it is culture dependant
|
|
|
|
|
thank you. i've been struggling with this one for a while now...
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Thank you thank you THANK YOU
i used Convert.ToDateTime(cdata.Birthdate.ToShortDateString()).ToString("MMMM")
and it works great.
I get the month name now. Thank you.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
NarutoFan#1 wrote: Convert.ToDateTime(cdata.Birthdate.ToShortDateString()).ToString("MMMM")
Just a side point, its not necessary to convert a date to a string then back to a date, this could just as easily be
cdata.Birthdate.ToString("MMMM");
|
|
|
|
|
hi
you can use a simple switch statment like:
Switch (monthnumber){
case 1: monthname = "January";
case 2: monthname = "February";
.
.
.
etc
}
Jmail abou khalil
|
|
|
|
|
Hi,
I have a dropdown control with few list item in it. I am setting the
DroppedDown property to true in the textchanged event to show the dropdown, the problem is the mouse coursor (the pointer) is not visible after the dropdown is shown, its stuck
inside the dropdown and only when the focus comes out of the control I am
able to see the Mouse pointer again. Am i missing something.
Regards
Deepak
|
|
|
|
|
i am using a inkpicture box for loading images, i want to draw over that image
so that using ink.and how can i insert ink into that image?
|
|
|
|
|
please ans: i do a graphics project ,i want to known can i draw over a image
using pen or brush.in c#
please response.......
|
|
|
|
|
using (Graphics gr = Graphics.FromImage(image))
{
// Draw on the bitmap using the graphics object
}
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i am using like this.
img = (Bitmap)Bitmap.FromFile(ofd.FileName);
Graphics gr = Graphics.FromImage(img);
gr.DrawEllipse(new Pen(Color.Black), new Rectangle(300, 300, 10, 50));
doc[1].inkPicture1.Image =
and i am using a ink picture box how to add his graphics object to this picture box
|
|
|
|
|
sathishtl007 wrote: how to add his graphics object to this picture box
You don't. You add a bitmap to a picture box, and you use a graphics object to change a bitmap.
doc[1].inkPicture1.Image = img;
should show your ellipse, assuming it's not on a bitmap that's all black anyhow. ( and that the bitmap is larger than 300 x 300, otherwise, you drew it off the bitmap )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
one more Question ?
how to place a image over an image?
and how can i save this grouped images?
|
|
|
|
|
sathishtl007 wrote: how to place a image over an image?
gr.DrawImage will draw an image into a graphics object. If that graphics object is made from another Image, they get drawn onto each other
sathishtl007 wrote: and how can i save this grouped images?
That's two questions
Just to be clear - you have only one bitmap, the bitmap you draw over it is not a grouping of images, it's a bitmap where a block of pixels has been changed to look like the source bitmap.
The Bitmap class has a Save method.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Im using an external dll called yWorks. I need to strong name it to work with my project. I've read into sn.exe and al.exe, but cant seem to get it working.
Any help would be greatful.
Regards,
Gareth.
|
|
|
|
|
I found the answer to my question, thus i thought i would reply to my self incase anyone else ever searched for the same problem.
http://research.microsoft.com/~mbarnett/ILMerge.aspx
The above link is what you should use if you ever need to sign a dll which you have not created with a strong name.
Regards,
Gareth.
|
|
|
|
|
Clickety[^]
Use the link[^] command below to make your link usable.
|
|
|
|
|
Hi I am sure this is a stupid question, but I can't work it out and its driving me mad.
I have a asp.net C# web page. (Visual Studio 2005)
In the class declarations at the top I have declared a
<br />
Public String strTeacherName;<br />
In a button click method I give the string a value
<br />
protected void btnBook_Click(object sender, EventArgs e)<br />
{<br />
strTeachername = "xxx";<br />
}<br />
In a second button click methods I try to use the variable, but it is empty
<br />
protected void btnConfirm_Click(object sender, EventArgs e)<br />
{<br />
lblMessage.Text = "You booked your lesson with " + strTeacherName;<br />
}<br />
I am assuming that the second postback is clearing the value of strTeachername. What is the best way of passing the variable from one method to the other. At the moment I am using a Session variable, but that can't be the best way.
Any advice greatly appreciated...
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
i can not see any error in the way u are using the variable. you should look on another place where you are using this variable and making it empty. Try the find utility (Ctrl + F) and type the variable name it will lead u at all the places where the variable is found.
if you can provide all the code, maybe i can help more
Jamil abou khalil
|
|
|
|
|
That's because it's an ASP.NET question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|