|
I want to have a tree node selected when the page loads. I have the number or ID or value of the node when the page loads. how do i achieve this? please help.
|
|
|
|
|
Hi.
first you have to find the node:
TreeView.Nodes.Find
Then select it:
TreeView.SelectedNode = <your selected node>
And you can do other stuff:
TreeNode.Expand();
TreeNode.EnsureVisible();
Kjetil
|
|
|
|
|
Hi Kjetil,
Thanks a ton.
It didn't work. Maybe you are talking about a windows-based TreeView control. I am using the control on a webpage. The TreeView.Nodes.Find function doesnot exist.
|
|
|
|
|
shehezada wrote: TreeView.Nodes.Find function doesnot exist
In that case you may have to iterate through all the nodes and check it's value/ID or whatever you need - when you find a match, set the selectednode property and break out of your loop.
Dave
|
|
|
|
|
Hi
Sorry. My mistake.
I'm in a big WinForm project, and have "forgotten" all about Web
Kjetil
|
|
|
|
|
Hello,
I want to know how to send mail from a windows application.
Thanks.
Dad
|
|
|
|
|
If you go to the top of this page you will see a textbox labeled SEARCH. Try that, there are loads of articles and code samples. If that doesn't help, try Google, again there are lots of very good examples.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
include
//---------------------------------------------------------------------------
using System.Web.Mail;
public static string SendMail(int pintUserID, string pstrMailTo, string pstrMailBcc,string pstrMailCc,string pstrMailSubject,string pstrMailBody,string pstrAttachFilePath)
{
try
{
MailMessage objMail = new MailMessage();
objMail.From = System.Configuration.ConfigurationSettings.AppSettings["FromEmailID"];
//objMail.From =System.Web.HttpContext.Current.Session["OfficeEmailID"].ToString() ;
objMail.To = pstrMailTo;
objMail.Bcc = pstrMailBcc;
objMail.Cc = pstrMailCc;
objMail.Subject = pstrMailSubject;
MailAttachment Attachment = null;if (File.Exists(pstrAttachFilePath))
{
Attachment = new MailAttachment(pstrAttachFilePath);
}
objMail.Attachments.Add(Attachment);
SmtpMail.SmtpServer = "localhost";//System.Configuration.ConfigurationSettings.AppSettings["SMTPServerIP"];
SmtpMail.Send(objMail);return "TRUE";
}
catch(Exception Ex)
{
return Ex.Message;
}
}
Config file
<add key="SMTPServerIP" value="192.168.1.11">
call the function SendMail & enable your system SMTP server.
Thanks & Regards
|
|
|
|
|
If you provide answers to fools to lazy to use Google you will only encourage them.
Simon
|
|
|
|
|
|
Hello everyone,
When remote debugging a release version binary on a remote machine using Visual Studio 2008, there is error message from local host machine in Visual Studio when I try to see some local variable values.
The error message is (1st message is displayed when my mouse stops at the variable in Locals, the 2nd message is what is displayed when I pressed refresh button for the specific local variable),
--------------------
The value for this item is stale dues to a problem that occured while evaluating it. Hover your cursor over the refresh button for details.
newNumbers Cannot obtain value of local or argument 'newNumbers' as it is not available at this instruction pointer, possibly because it has been optimized away. int
--------------------
Such issue only happens with release version, debug version is fine. Any ideas how to solve this? I need to debug release version.
thanks in advance,
George
|
|
|
|
|
George_George wrote: Such issue only happens with release version, debug version is fine. Any ideas how to solve this? I need to debug release version.
You cant.
Why dont you just log the value in a logfile in stead?
|
|
|
|
|
Thanks leppie!
1.
You mean such situation is normal when debugging release version? And no way to solve?
2.
leppie wrote: Why dont you just log the value in a logfile in stead?
I want to debug without changing the existing code.
regards,
George
|
|
|
|
|
George_George wrote: You mean such situation is normal when debugging release version? And no way to solve?
Yes, it is called optimization, for starters it strip's all symbol names.
George_George wrote: I want to debug without changing the existing code.
Not possible.
|
|
|
|
|
Thanks leppie,
Actually, if all symbols can not be displayed, I will not be so surprised. My confusion is why only a part of local variable can not be displayed?
regards,
George
|
|
|
|
|
This is my code to register a channel,
public static void startServer()
{
try
{
ChannelServices.RegisterChannel(channel); // exception occurs RemotingConfiguration.RegisterWellKnownServiceType(typeof(Messanger.ItvMessage), "testMessage", WellKnownObjectMode.SingleCall);
}
catch (Exception ex)
{
throw ex;
}
}
Here I am getting exception saing,” The channel 'tcp' is already registered”….
Are there any condition to check channel already registered or something..validation/….
|
|
|
|
|
This is my code to register a channel,
public static void startServer()
{
try
{
ChannelServices.RegisterChannel(channel); // exception occurs RemotingConfiguration.RegisterWellKnownServiceType(typeof(Messanger.ItvMessage), "testMessage", WellKnownObjectMode.SingleCall);
}
catch (Exception ex)
{
throw ex;
}
}
Here I am getting exception saing,” The channel 'tcp' is already registered”….
Are there any condition to check channel already registered or something..validation/….
|
|
|
|
|
Hai,
I am with a InventoryManagement C# windows application, how can I make a setup package for my application which prompts a serial number while installing the setup and also how can I add my icon to the setup project
Thanks in advance
Anu Palavila
Thanks & Regards
|
|
|
|
|
hey guys
does anyone know what the newline char is for MS-SQL2000?
i need to be able to INSERT it in a text column from my front end, and view it on a DataGridView and crystal reports...
i googled but didn't find anything useful, is it even possible?
any ideas?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
It depends on where you are displaying the data. If it is on an ASP.NET page then newline char will be <br> . Try Environment.NewLine
|
|
|
|
|
WinForms app, it will be displayed on a DataGridView and Crystal Report
Environment.NewLine has the same affect as "\r\n"...
i just noticed that its displaying correctly on the crystal report, but im seeing the square-like character in the DataGridView which is where the data is seen before the report is generated.
is there may be some property on the DataGridView to make it interpret the new line as a new line instead of the square-like character?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Looks like it don't support displaying multi line text. I am not sure about making gridview to display multi line text.
|
|
|
|
|
I have a while loop in my code...
for example, while (i<5)
{
do something
}
I want to read the value '5(the number specified in config file)' from app.config file. How do I go about it?
Basically I want to say the number of iterations from the config file.
Thanks for any suggestions.
Tina_K
modified on Tuesday, July 8, 2008 11:25 AM
|
|
|
|
|
int myCounter = Int32.Parse(ConfigurationManager.AppSettings["NumberOfLoops"]);
while (myCounter < 5)
{
doStuff();
}
remember to add using System.Configuration;
hope it helps
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Thanks, it worked great.
Tina_K
|
|
|
|