|
To place toolstrip under menustrip, follow the z-order mechanism. i.e., add the controls last as it will display it first(top). It takes reverse mechanism.so, add your controls in reverse order.
|
|
|
|
|
Hi all,
How to calculate the difference between two dates Ignoring Weekends ?
I have used TimeSpan to calculate difference between two dates, But I
need to know how I can ignore Weekends by using C#.
Thanks in advance.
|
|
|
|
|
KhaledK wrote: I
need to know how I can ignore Weekends by using C#
You'll need to define what days are weekend days in your code and check if the weekend days land in between your two dates...
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
hi
my table in sql2005 have a nvarchar DataType that save string values, but when i insert values in my code it is show "???????" symbols.
now i want to convert my textBox.text to utf-8 Encoding and save to SqlServer, but how to do this ??(convert to utf-8 Encoding string)
thanks
|
|
|
|
|
You can use the Encoding.UTF8.GetBytes method to convert a string into an UTF-8 encoded byte array, that you can store in a binary field in the database.
I'm not sure that's what you are looking for, though. It sounds like you want to store the string in the nvarchar field that you already have, but an nvarchar field does not use UTF-8 encoding.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Hi All,
I would like to auto create a textbox(s)and a button which base on the user choose the number in the dropdown list.
Once the page generate the textbox(s) and the user can fill in the vlues for each of the box and then submit to the DB. Any idea? Thanks
gsdg
|
|
|
|
|
I've written up how to add a button to a form, here : http://www.codeproject.com/useritems/DynamicallyAdding_Button.asp
To add a textbox, just follow the instructions but with a textbox instead of button.
something like this;
TextBox myTextbox = new TextBox();
myTextbox.Name = "inputbox_1";
myTextbox.Left = 100;
myTextbox.Top = 100;
this.Controls.Add(myTextbox);
To loop through a the text boxes, do something like this;
foreach (object myTextBox in this.Controls )
{
if (myTextBox.GetType().ToString() == "System.Windows.Forms.TextBox")
{
TextBox thisText = (TextBox)myTextBox;
MessageBox.Show(thisText.Name );
if(thisText.Name.SubString(thisText.Name.Lenght-1)=="inputbox_")
{
}
}
}
This is very basic, friday afternoon, off the top of my head, just before xmas code. So there are better ways of doing this, but this should get you started..... . ...
MarkPM
|
|
|
|
|
Hi all,
I have a working BHO in C# - a browser helper object - which can find things on a webpage based on the element's id attribute value.
Now I wish to retrieve the text or word anywhere on any webpage that the user has clicked on. I have done this the ATL/C++ way but I'm nowhere near finding a solution to this in C#/COM Interop.
Anybody with the experience? Help is REALLY appreciated!!!
/T
|
|
|
|
|
I’m currently working on a website that we are trying to make accessible. Now I added a page to the site which provide some drop down lists to the users. Such as background color (bgcolor), text size, zoom in (? Not sure how yet), font and things like that. The problem is my very limited experience with ASP.Net. I am a starter. I’d appreciate if one of you guru’s can help me out. Now I can’t or perhaps I should say don’t want to use Java script (user requirement). So basically I have to write server side code that will perform those things (change color, size, font ) etc. Now in my HTML code I have added the runat = “server” attribute to the form element. But that only exposes the Style property when I use it in code behind (under Page_Load event). I don’t want to use style because we won’t be using a CSS for this and I think style property only works with CSS. Since I will be hard coding a few values below in my drop down list and set the values of the color to their hexadecimal value such as #00ff00 for green.
<br />
All I want to be able to do when the user clicks the Button, the page and a few more pages will adopt those properties and change color, font etc. The later having the other pages adopt the same values is something I have figured out (I’m planning on using session state for that) Please help me out with this. I even tried exposing a runat = server attribute to the element so that I could programatically change the value of the whole body under the button_click event. But that didn’t work either. Thanks~ Tina
|
|
|
|
|
Tina P wrote: The problem is my very limited experience with ASP.Net. I am a starter.
That is what tutorials are for. Go find one there are many. For sure on MSDN and perhaps on Code Project. Here is a tutorial for using CodeProject forums:
ASP.NET Questions should be posted in the ASP.NET forum.
led mike
|
|
|
|
|
Tina P wrote: don’t want to use Java script
ASP.NET works entirely by sending javascript to the client. You probably can't use ASP.NET in any meaningful way, and meet this requirement.
Tina P wrote: and I think style property only works with CSS
CSS allows you to name styles. You can use the style property to set the style of a single control, without using CSS.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I am working on a new project which I intend to release as Open Source. I did some looking around and the two strongest seem to be NLog and log4net. Both seem like they would meet my immediate needs, so I figured I would ask here to see what people think:
1) Are there any other logging packages I should consider?
2) Which logging package is most popular?
3) Which logging package is most popular in open source .NET projects?
4) Is there any clear pros and cons to these packages?
Thanks
|
|
|
|
|
NLog and Log4Net are both excellent packages. You may also want to consider XQuiSoft[^] and the minimalist EZLogger[^] (pardon the shameless plug ), both of which are published at CP.
/ravi
|
|
|
|
|
Can someone help me with this: vector length is 20 and starts from 0 to 20 it have to be like this 0,2,4,6,8,10,12,14,16,18,20
|
|
|
|
|
See here.[^]
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Good find! I'll just save that one in my Favorites.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Enjoy, I've been using it on and off for a year or so.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
but can u tell me then is there somthing right and why it does not end with 20
<code>#include <stdio.h>
int main()
{
int a ,i[20];
a=20;
for (i=0; i<a; i=+2)
{
printf("%i");
}
return 0;
}
</code>
|
|
|
|
|
There are really many things wrong.
#1: the for loop should be either i=i+2 or i+=2
#2: you're not assigning values to the array i
#3: you're using i (which is an array) as the variable in the for loop.
|
|
|
|
|
You forgot one - it's C code, in a C# forum.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
Hi! Welcome to code project. Since this was your first post, let me remind you of something that you may have glossed over when setting up your account and making your first post.
Firstly, we don't do work for you. Well, unless you're going to pay us. CP is a community of people who help each other through issues, and learn from each other's mistakes/trials/succeesses.
Is this homework? Seems like it, especially with a problem that simple.
Are you looking for the specific object to use to hold that collection of numbers, or why one collection might be better than another?
Are you looking for advice on the methods to generate that sequence, whether to use a foreach statement, for loop, while loop, or do while loop? We'll probably be able to give you advice on your case as well.
What have you tried so far? Tell us what hasn't worked, and we'll give you advice on how to make it work, or other things to try that might work better.
|
|
|
|
|
i want do know why this program doesnt end can u give me advise `?
|
|
|
|
|
First, this is the C# forum, not the C or C++. There are seperate forums for them.
Next, it doesn't end because of your for statement. THere is something very wrong with the end of that line. What's wrong with the bolded part and what is that clause, as you've written it, actually doing?
for (i-0; i<a; i=+2)
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I think you wanted +=, not =+.
As someone said, you need to post in the right forum, this is C#.
Also, your first port of call should be to set a break point in your program, then you can step through and see why it's behaving as it is. F9 sets a breakpoint, F5 starts debugging.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|