Click here to Skip to main content
       

C#

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few timesmembershoab.shah27 Feb '13 - 0:18 
Here is a part of code
 
 string FAXFilePrefix = Helper.Helper.GetConfigValue("FAXFilePrefix");
                string domainName = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;
                string location = GetLocalStoragePath() + FAXFilePrefix + requestViewModel.encounter.ServiceEncounterID + "_" + uniqueId.ToString() + ".docx"; // Backup (archive/todaysdate folder)

                MvcApplication.TraceSource.TraceEvent(TraceEventType.Information, 100, "Before Accessing UNC path ");
 
                using (Carena.PCHA.CoreServices.UncPath.UNCAccessWithCredentials unc = new Carena.PCHA.CoreServices.UncPath.UNCAccessWithCredentials())
                {
                    if (unc.NetUseWithCredentials(Path, userName, domainName, Password))
                    {
                        MvcApplication.TraceSource.TraceEvent(TraceEventType.Information, 100, "Before docx.SaveAs ");
 
                        MvcApplication.TraceSource.TraceEvent(TraceEventType.Information, 100, "Location - "+location);
                        try
                        {
                            docx.SaveAs(location);
                        }
                        catch (Exception ex)
                        {
                            loggerl.LogException(ex);
                        }
                        MvcApplication.TraceSource.TraceEvent(TraceEventType.Information, 100, "After docx.SaveAs ");
                    }
 

It throws exception at docx.SaveAs(location); line
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few timesprotectorPete O'Hanlon27 Feb '13 - 0:32 
I don't see anything in there to do with this DllImport code though. Is this what's happening inside this docx component? If so, I suggest that you should raise it on the support forum for that component.
I was brought up to respect my elders. I don't respect many people nowadays.

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few timesmembershoab.shah27 Feb '13 - 1:07 
Ok, i have posted question in http://docx.codeplex.com[^]
 
Lets see
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few timesmvpRichard MacCutchan27 Feb '13 - 3:46 
Given that you have provided even less information than posted here, I would be surprised if you see anything. Why not use your debugger to diagnose the exact situation at the point of failure and then provide all the information that you have, so someone can try and help you?
Use the best guess

GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few timesmvpDave Kreskowiak27 Feb '13 - 1:07 
OK, so what's the EXACT contents of location when it fails??

GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few timesmembershoab.shah27 Feb '13 - 1:10 
\\remote comp ip\foldername\filename.docx which is correct
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few timesmvpDave Kreskowiak27 Feb '13 - 1:19 
That's not the EXACT contents. That's just the format you expect it to be in when this code runs.

GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few timesmembershoab.shah27 Feb '13 - 19:07 
Its true that what i have shown is format. But i can't show the actual path. The path i get is as expected
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few timesmvpDave Kreskowiak28 Feb '13 - 1:29 
Oh well, I guess you're on your own now, because the problem seems to be with that path.

QuestionC# datetime compared to sql server datetimememberclassy_dog26 Feb '13 - 18:45 
In a C# 2010 desktop application I am using a linq to sql statement to compare a C# datetime field to a sql server 2008 r2 datetime field. By doing this comparison I am getting inconsistent results. Thus I am guessing a C# datetime field is not the same as a sql server 2008 r2 datetime value.
 
Thus for this comparison to work, I would like to know how to change a C# datetime field to a sql server date time field. I would think I would need to do this conversion prior to comparing the dates.
 
Thus now you show me code and/or point me to a reference that will show me how to solve this problem?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 24 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid