Click here to Skip to main content
       

C#

 
Question[DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah26-Feb-13 21:04 
AnswerRe: [DllImport("NetApi32.dll"... throws exception for first few times PinmvpRichard MacCutchan26-Feb-13 23:33 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah27-Feb-13 0:20 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinmvpRichard MacCutchan27-Feb-13 0:37 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinprotectorPete O'Hanlon27-Feb-13 0:46 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah27-Feb-13 1:12 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinprotectorPete O'Hanlon27-Feb-13 1:15 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah27-Feb-13 1: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 times PinprotectorPete O'Hanlon27-Feb-13 1:32 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah27-Feb-13 2:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinmvpRichard MacCutchan27-Feb-13 4:46 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinmvpDave Kreskowiak27-Feb-13 2:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah27-Feb-13 2:10 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinmvpDave Kreskowiak27-Feb-13 2:19 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah27-Feb-13 20:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinmvpDave Kreskowiak28-Feb-13 2:29 
QuestionC# datetime compared to sql server datetime Pinmemberclassy_dog26-Feb-13 19:45 
AnswerRe: C# datetime compared to sql server datetime PinprotectorPete O'Hanlon26-Feb-13 20:36 
AnswerRe: C# datetime compared to sql server datetime Pinmembermanghal27-Feb-13 0:11 
GeneralRe: C# datetime compared to sql server datetime PinprotectorPete O'Hanlon27-Feb-13 1:07 
GeneralRe: C# datetime compared to sql server datetime Pinmemberclassy_dog27-Feb-13 3:04 
GeneralRe: C# datetime compared to sql server datetime PinprotectorPete O'Hanlon27-Feb-13 3:13 
GeneralRe: C# datetime compared to sql server datetime Pinmemberclassy_dog27-Feb-13 4:56 
GeneralRe: C# datetime compared to sql server datetime PinprotectorPete O'Hanlon27-Feb-13 5:12 
GeneralRe: C# datetime compared to sql server datetime PinmemberMatt T Heffron27-Feb-13 11:07 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 27 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid