|
My best suggestion:
Look at Visual Studio as a productivity tool. If you lean on the designer very heavily, your ability to grasp several concepts might be stunted(delegate registration comes to mind)
I would suggest using Visual Studio to get yourself up and moving....learn the syntax of the language, and then step back a little bit and figure out what exactly it is that the IDE generates for you. Learn the concepts of explicitly declaring your own controls(will probably help you along your way to learning how to develop custom user controls, should you ever need to)....learn how to explicitly register and de-register event handlers.(This is usually your first exposure to delegates in the language) ....and once you get the concepts down, you will realize that the code that VS generates for you is generally very trivial and you can go back to letting it do its thing for you...with the knowledge of what it is doing, you will be able to tweak it if it's "canned" generation is ever not what you actually needed it to do.
"I need build Skynet. Plz send code"
|
|
|
|
|
Is there a IN operator in c#
I need to perform an operation like below:
if (item in Array[]/Arraylist[])
delete item
Regards,
Pavas
|
|
|
|
|
try to use if(array.Contains(item))
My small attempt...
|
|
|
|
|
Ohh yeh, thanks a lot.
Regards,
Pavas
|
|
|
|
|
uhhh......why not just suggest that he use the "in" keyword?
"I need build Skynet. Plz send code"
|
|
|
|
|
Alaric_ wrote: uhhh......why not just suggest that he use the "in" keyword?
What "in" keyword can be used in an if statement?
|
|
|
|
|
I think he's talking about the IN keyword (that he didn't bother reading the docs on) used in Linq.
|
|
|
|
|
Hi all,
I'm using a DateTimePicker Control to select a day (01/01/2008 for example)
is there a way to customise the Date Format so that I can use Relative Date ?
for example today is 03/01/2008 and I want to select 01/01/2008 so I just write -2d (relative date from today)
thanks for any ideas
|
|
|
|
|
that you can simply achieve thru code right?
My small attempt...
|
|
|
|
|
I can't enter (-2D) because the Date format is fixed ("MM dd yyyy" for example)
is there a way to enable editing the Date value without checking the format
or is there a way to create a relative format
sure when I get -2D in the Value property I can achieve thru code
thanks
modified on Thursday, January 03, 2008 7:13:19 AM
|
|
|
|
|
I am developing a windows application which needs automatic update. Any idea on how to implement this ?
|
|
|
|
|
ClickOnce does that, doesn't it ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: ClickOnce does that, doesn't it
Thanks, I checked and it does. But I am just trying other way. I will keep a web service which gives update notifications to the windows application. Windows application will download updates and invoke update program(a separate program I will make). This new program will close current running application and update the exe's with new one downloaded, and restarts the application. Do you think it's a fair idea ?
|
|
|
|
|
it's not going to work under vista. It is however how i used to do stuff prior to things like ClickOnce.
I guess even on vista you could call an update exe in your install root requesting elevated priviledges and then quit. This would leave the update exe able to copy over your old exe. You'd also need to think of a way of replacing the updater if the code in there needed replacing.
What will you do about things like host file redirects to ensure that malicious software doesn't use your update service to get a payload onto the machine?
The app i'm currently working on is the kind of app that the network admins would go nuts if we caused an update without telling them so we provide a message in program telling them to run an update at their own convenience.
It's such a shame that user's can't add repositories to windows update like you can in yum or aptitude, it would be so good to have a central updating system that could be controlled by net admins etc; on the plus side we got a round start button and glass effect windows so i suppose we shouldn't complain.
Russell
|
|
|
|
|
Thanks Russel. So ultimately you suggest ClickOnce ?
|
|
|
|
|
|
Vasudevan Deepak K wrote: http://windowsclient.net/articles//appupdater.aspx[^]
Thanks Vasudevan. That was helpful.
|
|
|
|
|
Hi
I set a view state as following:
ViewState["roomsql"] = SqlDataSource_rooms_to_update.SelectCommand.ToString();
I then use an if statement to check if its blank:
if ((string)ViewState["roomsql"] == "")
however the if statement doesn't work as it constantly reads the viewstate as having a value in it when it doesn't
has anyone encountered this problem before?
thanks
|
|
|
|
|
If (string)ViewState["roomsql"] contains a null value then your statement if ((string)ViewState["roomsql"] == "") will always return false.
Try checking for null rather than "".
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
Use string.IsNullOrEmpty((string)ViewState["roomsql"])
And I really wouldn't recommend you storing SQL in the viewstate. It is too easily read and the SQL would likely contain information that a hacker would find useful.
|
|
|
|
|
I'd also advise against it because it's just plain bad practice coupling the view to the database like this.
|
|
|
|
|
Pete O'Hanlon wrote: it's just plain bad practice coupling the view to the database like this
Good point.
|
|
|
|
|
Hi everybody!
I want to serialize a B+ tree. My class structure is the following:
class BPlusTree
{
private Node root;
private int nodeSize;
private class Node
{
private List<node> nodes;
private List<object> keys;
private bool isLeaf;
private List<object> values;
private Node parent;
private int size;
}
}
I don't know if it is possible to serialize a tree.All the example which i found serialize just simply classes. None of them didn't serialize a class which has an inner class.
Is it possible to make this tree serializable? If it possible how can i make this?
Thanks a lot for your help!
Have a nice day!
|
|
|
|
|
Mark both classes as Serializable, and implement a public property for each field. It can now be serialized.
|
|
|
|
|