|
You can use Dataset.ReadXml.
|
|
|
|
|
i tried with that and got an error 'Illegal characters in path.', and please check with the xml structure that i have given.
so i the dataset the values will be like this
statiid custNo status value
--------- ------ ------ -----
1 A1258 1 not found
and to your knowledge the xml data is in a string variable in this format.
thanks & regards
karthi
|
|
|
|
|
Just as the subject says... which is the best way of knowing when a file is locked by another application? the only way I know to do this is trying to open and work with the file and catching the exception, and wonder if there is any other faster method.
Plus if I'd wish to work with several files at once where each one depends on the previous one I'd have to use nested try...catch blocks, and you know, I appreciate my eyes.
|
|
|
|
|
|
I guess you are telling me to plain use a FileSystemWatcher, because using it together with a service is something just not feasible when any file on the computer may be open.
Will this work? Always used FileSystemWatcher for being aware about changes in a file or folder since it starts working, I didn't know it could give information of the current status of a file. Anyway, wouldn't this need a lot of resources for just trying to open a file?
Well, I'll give it a look when I return at home.
|
|
|
|
|
When you open the filestream, request non shared access, it will fail then, and not later.
|
|
|
|
|
Well, that's what I'm already doing.
I'd like to know if there is some function (I don't care if it isn't a managed one) that directly tells if a file is locked by another application, that way I wouldn't need to use nested try...catch blocks.
|
|
|
|
|
Neverbirth wrote: that way I wouldn't need to use nested try...catch blocks.
Why do you need that? Just refactor the file opening process to a method and handle this specific scenario.
|
|
|
|
|
I am getting this kind of error,in my application i cant get it debugging. it is happening in running.
Can U please tell me the reason here i have exception log.
--------
Attempted to read or write protected memory. This is often an indication that other memory is corrupt. :: System.Windows.Forms :: at System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG& msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ItvC.Program.Main() in C:\ItvCNew180508\ItvC\Program.cs:line 29
|
|
|
|
|
Do you do anything with unmanaged components in your code ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
yes i haved used ocx,dll and activeX controls in my application.
Any good practice in Assembly.cs file also??
|
|
|
|
|
One of those is what's crashing, so you need to look at your code that calls these.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
are you using any 3rd party SDK's or .Net wrappers?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
If your application is crashing and you want to solve the problem no matter what, I would suggest you throw messageboxes all over the beginning of your code. When a messagebox does not show when it is suppose to then that is where the problem is occuring. I am almost positive that most programmers would consider this a messy solution and would only use it as a last resort, it should be able to assist you.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Hey guys.
ive got two panels and 6 maskedTextBoxes on a control im writing...
i need the maskedTextBoxes to go "over" one of the panels(not inside, this is for when the control is resized), at the moment the panel goes over the maskedTextBoxes ... isnt there some kind of a layer property where i can set which control is top most?
i remember somthing like that in delphi...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
I think you can use BringToFront() or SendToBack() for this.
|
|
|
|
|
sweet, worked perfectly... didn't know those methods existed...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Hi !
I'm trying to open internet explorer and show a web page on it .
I also want to post some data to the web page.
My problem is that I don't want to reopen a new web browser for the same URL. I want to reuse the same web browser and post some data to that url again.
I tried to use SHDocVw.InternetExplorer and SHDocVw.ShellWindows.
This is what i can do so far.
SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
ie.Visible = false;
ie.Navigate2(ref vUrl, ref vFlags, ref vTargetFrame, ref vPost, ref vHeaders);
Is there anybody can help me ?
Thanks
|
|
|
|
|
Create this one times
SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
ie.Visible = false;
use this many times
ie.Navigate2(ref vUrl, ref vFlags, ref vTargetFrame, ref vPost, ref vHeaders);
i hope this will help
dhaim
program is hobby that make some money as side effect
|
|
|
|
|
Hi dhaim!
Thanks for your reply.
Maybe I'm not clear in explaning the problem.
I have a C# Console Application (this console application will launch internet explorer) that will be called by Access VBA.
So, it's not possible for the Access VBA to maintain the reference to the console application.
I need a way to read the current launch internet explorer and check the url and reposting certain data again to the web.
Could anybody help me to solve this problem ?
Thanks
|
|
|
|
|
hi i am using crytal report to print my values from the database
in my database i have 3 rows...
Category Quantity Unit_RAte
apple 5 60 RS
mango 10 80 Rs
if i select mango and i have to print the mango for 10 times in my report
i should get the result as ,
mango 10 80 Rs
mango 10 80 Rs
apple 5 60 RS
apple 5 60 RS
apple 5 60 RS like this i have to get the 20cm space for each rows.....
|
|
|
|
|
in the design page increase a little bit space below the item that u have placed in the page. so u get the space for each and every item u bind there.
|
|
|
|
|
try
{
smtpClient.Send(mailMessage);
}
catch (Exception ex)
{
eventLogImport.WriteEntry("SMTP Email error: could not send email.", EventLogEntryType.Warning);
}
Hi,
The above code still throws an unhandled SMTPException when smtpClient.Send is called.
SMTPException is derived from System.Exception so should it not be caught?
Thanks
|
|
|
|
|
Hmmm... if the smtpClient uses another thread, this won't be caught, you need to actually set a handler for exceptions from another thread.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Interesting.
This is occuring in an event handler, however i thought the method which triggers the event should be on the same thread. I'll look into it as there is some SQL data access going on which may make and asynchronous call.
Thanks!
|
|
|
|