|
Without the way of error, I want to check the file is opened or not.
Balasubramanian K.
|
|
|
|
|
Use Simply Try - Catch Block if Exception occured then give the message.
|
|
|
|
|
By error only, we r saying the msg.
I need to check like How we r checking the conn string. is opened or not. As well as, I need to check the mdb file is opened or not, If it is opened, I have to throw msg to say close it..
Balasubramanian K.
|
|
|
|
|
BalasubramanianK wrote: I need to check like How we r checking the conn string. is opened or not
I think ther is a propery with Connetion Class
Try to Check with that
Coon is your Connection
Conn.Status
it will give you the result !!!! Please check it and let me know.
BalasubramanianK wrote: , I need to check the mdb file is opened or not, If it is opened, I have to throw msg to say close it..
If the mdf file is open , it should throw the exception isnt it!!!
now
try
{
//Try to open connection
//If file is open then it should throw the exception
}
catch
{
//Handeld Exception
}
|
|
|
|
|
Tnx Mr. Jana..If there any other way, just u tell me.
Balasubramanian K.
|
|
|
|
|
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
|
|
|
|