Click here to Skip to main content
11,429,345 members (68,514 online)
   

C#

 
Question[DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah26-Feb-13 21:04
membershoab.shah26-Feb-13 21:04 
AnswerRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Richard MacCutchan26-Feb-13 23:33
mvpRichard MacCutchan26-Feb-13 23:33 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 0:20
membershoab.shah27-Feb-13 0:20 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Richard MacCutchan27-Feb-13 0:37
mvpRichard MacCutchan27-Feb-13 0:37 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Pete O'Hanlon27-Feb-13 0:46
protectorPete O'Hanlon27-Feb-13 0:46 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 1:12
membershoab.shah27-Feb-13 1:12 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Pete O'Hanlon27-Feb-13 1:15
protectorPete O'Hanlon27-Feb-13 1:15 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 1:18
membershoab.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 Pin
Pete O'Hanlon27-Feb-13 1:32
protectorPete O'Hanlon27-Feb-13 1:32 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 2:07
membershoab.shah27-Feb-13 2:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Richard MacCutchan27-Feb-13 4:46
mvpRichard MacCutchan27-Feb-13 4:46 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Dave Kreskowiak27-Feb-13 2:07
mvpDave Kreskowiak27-Feb-13 2:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 2:10
membershoab.shah27-Feb-13 2:10 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Dave Kreskowiak27-Feb-13 2:19
mvpDave Kreskowiak27-Feb-13 2:19 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
shoab.shah27-Feb-13 20:07
membershoab.shah27-Feb-13 20:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pin
Dave Kreskowiak28-Feb-13 2:29
mvpDave Kreskowiak28-Feb-13 2:29 
QuestionC# datetime compared to sql server datetime Pin
classy_dog26-Feb-13 19:45
memberclassy_dog26-Feb-13 19:45 
AnswerRe: C# datetime compared to sql server datetime Pin
Pete O'Hanlon26-Feb-13 20:36
protectorPete O'Hanlon26-Feb-13 20:36 
AnswerRe: C# datetime compared to sql server datetime Pin
manghal27-Feb-13 0:11
membermanghal27-Feb-13 0:11 
GeneralRe: C# datetime compared to sql server datetime Pin
Pete O'Hanlon27-Feb-13 1:07
protectorPete O'Hanlon27-Feb-13 1:07 
GeneralRe: C# datetime compared to sql server datetime Pin
classy_dog27-Feb-13 3:04
memberclassy_dog27-Feb-13 3:04 
GeneralRe: C# datetime compared to sql server datetime Pin
Pete O'Hanlon27-Feb-13 3:13
protectorPete O'Hanlon27-Feb-13 3:13 
GeneralRe: C# datetime compared to sql server datetime Pin
classy_dog27-Feb-13 4:56
memberclassy_dog27-Feb-13 4:56 
GeneralRe: C# datetime compared to sql server datetime Pin
Pete O'Hanlon27-Feb-13 5:12
protectorPete O'Hanlon27-Feb-13 5:12 
GeneralRe: C# datetime compared to sql server datetime Pin
Matt T Heffron27-Feb-13 11:07
memberMatt 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.150428.2 | Last Updated 3 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid