|
try<br />
{<br />
}<br />
Catch<br />
{<br />
}
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you then save my time by voting my post.
|
|
|
|
|
Actually, I need to check the mdb file is opened or not. I dont want to throw msg, if error exists. If file is opened I want to say to close the file...Tnx for ur reply
Balasubramanian K.
|
|
|
|
|
Open the file for exclusive access and catch the exception if it fails:
<br />
File.Open(Path, FileMode.Open, FileAccess.ReadWrite, FileShare.None)
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you then save my time by voting my post.
|
|
|
|
|
Is there anything like connection state?
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
|
ok thank you
Balasubramanian K.
|
|
|
|
|
any one please help me
I have the following code for Emailing .
My doubt is I am able to send mail only to gmail(as a spam) but not to other mail like yahoo(not even as a spam) etc. What could be the reason .I have even configured web.config file and ....Relay->127.0.0.1
kindly help me
Thanks in advance
---------->
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress(txtFrom .Text.Trim ());
mail.To.Add(txtTo.Text.Trim ());
//set the content
mail.Subject = txtSubject .Text ;
//first we create the Plain Text part
AlternateView plainView = AlternateView.CreateAlternateViewFromString("Some Plain Text" , null, "text/plain");
//then we create the Html part
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("<b>"+txtBody .Text.Trim ()+"</b>", null, "text/html");
mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView);
//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address
try
{
smtp.Send(mail);
Response.Write("Mail Sent...");
txtBody.Text = "";
txtFrom.Text = "";
txtSubject.Text = "";
txtTo.Text = "";
}
catch (Exception ex)
{
Response.Write (ex.ToString ());
}
<---------->Kovuru Sreedhar
|
|
|
|
|
Check to see if your IP Address(external) is blocked, or on a spam list. Also make sure you aren't sending messages with keywords that might tag it as spam.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
what are the possible keywords for spam mail?
Kovuru Sreedhar
|
|
|
|
|
it amy be any exe
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
hi
i m created one component inj windows application i can give the reference in my window application and can add this control in tool box in my windows application only.
but in my web application i can add reference this component dll i can be added. but i can not add this control in tool box .
please share your ideas with me how can i add user created windows component in web application
please help me
with regards,
bretto
|
|
|
|
|
The Page_PreInit() method should be invoked before the Page_Load() is called right ? As per the ASP .NET Page lifecycle PreInit is before Load. However when I try to debug that is not the case. My code in Page_PreInit() never gets called and the execution is passed directly to Page_Load(),
Any suggestions ?
|
|
|
|
|
Make sure it's hooked up right or that auto hookup is turned on and it's spelled right.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I think there is some problem in spelling .Please check it from
protected void Page_PreInit(object sender, EventArgs e)
{
//write your code here
}
Cheers!!
Brij
|
|
|
|
|
can you please show the code of what you doing?
|
|
|
|
|
I am developing an ASP.Net web application using C#. The application will display information on the page in a Datagrid. The application will have a "Save" button that will allow the user to save the information in the Datagrid into a CSV file on the client's desktop. I tried using Server.MapPath(), but all I get are paths on the server. Is there a C# function I can call to give the path to the client's desktop or do I need to use some Javascript function? Thanks.
|
|
|
|
|
javascript has no idea what a desktop is, and sure is not allowed to wander the clients file system. You can't do it.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Can you tell what class or function I need to use to get the "Save As" dialog box to pop up when the save button is press in ASP.Net using C#? Thanks.
|
|
|
|
|
|
Hi,
I am using window.print() to print the current window from Asp.net(VB) but now i want to set page size,printer name ,Orientation etc Programatically
Please help me.
Darshana Pathak
|
|
|
|
|
u can set printer settings from the dialog box that comes when window.print is invoked... Check Properties...
You cant change the default settings of the PRint dialog box from code. Its because of security issue..
But there is a way for IE users to call WScript.Shell. try out the code:
<pre>var shell;
function SetPrintProperties() {
try {
shell = new ActiveXObject("WScript.Shell");
shell.SendKeys("%fu");
window.setTimeout("javascript:SetPaperSize();", 400);
} catch (e) {
alert('Please verify that your print settings have a Landscape orientation and minimum margins.');
}
}
function SetPaperSize() {
shell.sendKeys("%a{TAB}.2{TAB}0{TAB}0{TAB}0{ENTER}");
}</pre>
But I dont recommend this as its browser specific and not a good practice to change settings without users consent....
Abhishek Sur
|
|
|
|
|
i tried it but its not working
Darshana Pathak
|
|
|
|
|
JS can't do this. Might be some activex controls can do.
|
|
|
|
|
Hi all,
In my web application i need to show a small message using a div in user registration form,message mean when user while moving to textboxes to insert data div should focus infront of that purticular textbox(message should dynamically change).Pls help me to do this
Thanks
|
|
|
|
|
tell me what is the problem with this...
just set the position of the div correctly using Style="left:##px;top:##px;Z-Index:#" of the div using Javascript on focus... and u are done...
No problems with this.... Simple as water
Abhishek Sur
|
|
|
|