For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
The code after the await statement won't execute until the awaitable is complete. Yes, this is a blocking call, KIND OF.
The difference is that the thread executing the await goes back to running other code that needs to run, like the applications message pump so UI updates are painted and button clicks and whatnot can still execute.
When the awaitable finally returns, the code after the await statement executes as normal.
I don't believe the VS setup project provides a way to install services. However, if the VS project supports custom actions, you could use a custom action to run the InstallUtil and your users would not have to run any separate utility.
The difficult we do right away...
...the impossible takes slightly longer.
I have made a context menu switch and a treeview! The context menu role is to delete the node on right click (from the delete button in menu of course) but the problem is that selectednode.text is always null! I want to get the text of the selected node and search in database to delete it from database! Here is the code
At the point of the exception the value of i is not valid for your array labels, probably it's too high. Place a debug-breakpoint on the line of the for-loop, run your program in debug mode, step through the iterations of the for-loop and you will recognize what's going wrong.
and the error is: Value cannot be null.Parameter name: device
The is the Code...
publicpartialclass Form1 : Form
privatevoid button1_Click(object sender, EventArgs e)
path = RasPhoneBook.GetPhoneBookPath(RasPhoneBookType.User);
using (RasPhoneBook pbk = new RasPhoneBook())
RasEntry entry = RasEntry.CreateBroadbandEntry("osama",RasDevice.GetDeviceByName("(PPPoE Osama)",RasDeviceType.PPPoE));
// Configure any options for your entry here via entry.Options
using (RasDialer dialer = new RasDialer())
dialer.EntryName = "Your Entry";
dialer.PhoneBookPath = path;
dialer.Credentials = new System.Net.NetworkCredential("User", "Password");
If there is another way please tell me how.
To Be Or Not To Be
But personally, I wouldn't do that - it encourages you to maintain a connection for teh life of the application which is a pretty poor practice. It also means that you only get one connection, so some operations are not possible - any INSERT or UPDATE while processing a SqlDataReader for example. I'd create the connections as I need them, inside a using block so that they are closed and disposed when I'm done.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
You never should create a variable for database connection in a global scope. It would consume resources even where you do not need a database connection. Such as, when user is not authenticated, and you're showing him a view (or a dialog box) to tell him that he cannot connect to the database for query purposes, but in the background database would be connected already. Which won't be a good usage of your logic or resources.
It would be better to create this variable, inside the function where you need it. Connection pooling would take care of the underlying connection maintenance for your application so that you won't get a delay for connecting to the database server.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~