|
Sorry, but I don't understand how could label.Bounds help me to determine the location of text on Lable??
|
|
|
|
|
The bounds (which is type Rectangle) has members for top, bottom, right, and left. (left, top) gives you the location of the label's upper-left corner.
|
|
|
|
|
I guess if you want to know where exactly the text is painted within the label, you'll have to get the control's graphics object, determine the text size with its MeasureString methhod, and calculate the position with a lot of if statements according to alignment and things. But that's kind of like reinventing the label.
|
|
|
|
|
Hi Frank
yes that is exactly what I need and I already calculated the position but it's not accurate, so I was asking if there is an existing method to do
|
|
|
|
|
Hey, can anybody help me?
|
|
|
|
|
as in VB 6.0 we have recordset.movelast what is it in asp.net using C# where database is sql server 2005?
|
|
|
|
|
There is no equivilent in ADO.NET, it works in an entirely different way. Your best bet is to Google ADO.NET and read up on datareaders and datasets.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
The SqlDataReader has no such method, please take a look at this below:
SqlDataAdapter s = new SqlDataAdapter("...sql...", Conn);
DataTable dt = new DataTable(); ;
s.Fill(dt);
DataRow dr = dt.Rows[dt.Rows.Count - 1];
Hope it's usefull for you!
Regards,
Dealon
Impossible is nothing!
|
|
|
|
|
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/….
|
|
|
|