Click here to Skip to main content
12,406,795 members (57,417 online)
   

C#

 
Question[DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah26-Feb-13 20:04
membershoab.shah26-Feb-13 20:04 
AnswerRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Richard MacCutchan26-Feb-13 22:33
mvpRichard MacCutchan26-Feb-13 22:33 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah26-Feb-13 23:20
membershoab.shah26-Feb-13 23:20 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Richard MacCutchan26-Feb-13 23:37
mvpRichard MacCutchan26-Feb-13 23:37 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Pete O'Hanlon26-Feb-13 23:46
protectorPete O'Hanlon26-Feb-13 23:46 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 0:12
membershoab.shah27-Feb-13 0:12 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Pete O'Hanlon27-Feb-13 0:15
protectorPete O'Hanlon27-Feb-13 0:15 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 0:18
membershoab.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 times Pin
Pete O'Hanlon27-Feb-13 0:32
protectorPete O'Hanlon27-Feb-13 0:32 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 1:07
membershoab.shah27-Feb-13 1:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Richard MacCutchan27-Feb-13 3:46
mvpRichard MacCutchan27-Feb-13 3:46 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Dave Kreskowiak27-Feb-13 1:07
mvpDave Kreskowiak27-Feb-13 1:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 1:10
membershoab.shah27-Feb-13 1:10 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Dave Kreskowiak27-Feb-13 1:19
mvpDave Kreskowiak27-Feb-13 1:19 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 19:07
membershoab.shah27-Feb-13 19:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Dave Kreskowiak28-Feb-13 1:29
mvpDave Kreskowiak28-Feb-13 1:29 
QuestionC# datetime compared to sql server datetime Pin
classy_dog26-Feb-13 18:45
memberclassy_dog26-Feb-13 18:45 
AnswerRe: C# datetime compared to sql server datetime Pin
Pete O'Hanlon26-Feb-13 19:36
protectorPete O'Hanlon26-Feb-13 19:36 
AnswerRe: C# datetime compared to sql server datetime Pin
manghal26-Feb-13 23:11
membermanghal26-Feb-13 23:11 
GeneralRe: C# datetime compared to sql server datetime PinPopular
Pete O'Hanlon27-Feb-13 0:07
protectorPete O'Hanlon27-Feb-13 0:07 
GeneralRe: C# datetime compared to sql server datetime Pin
classy_dog27-Feb-13 2:04
memberclassy_dog27-Feb-13 2:04 
GeneralRe: C# datetime compared to sql server datetime Pin
Pete O'Hanlon27-Feb-13 2:13
protectorPete O'Hanlon27-Feb-13 2:13 
GeneralRe: C# datetime compared to sql server datetime Pin
classy_dog27-Feb-13 3:56
memberclassy_dog27-Feb-13 3:56 
GeneralRe: C# datetime compared to sql server datetime Pin
Pete O'Hanlon27-Feb-13 4:12
protectorPete O'Hanlon27-Feb-13 4:12 
GeneralRe: C# datetime compared to sql server datetime Pin
Matt T Heffron27-Feb-13 10:07
memberMatt T Heffron27-Feb-13 10:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web02 | 2.8.160730.1 | Last Updated 30 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid