Click here to Skip to main content
15,893,998 members
Home / Discussions / C#
   

C#

 
QuestionHTML.Kendo.ComboBox [Error: Object doesn't support property or method 'requestData'] Pin
Atul Shriram rane11-Oct-16 17:57
Atul Shriram rane11-Oct-16 17:57 
AnswerRe: HTML.Kendo.ComboBox [Error: Object doesn't support property or method 'requestData'] Pin
NotPolitcallyCorrect12-Oct-16 4:53
NotPolitcallyCorrect12-Oct-16 4:53 
GeneralRe: HTML.Kendo.ComboBox [Error: Object doesn't support property or method 'requestData'] Pin
Pete O'Hanlon12-Oct-16 4:59
mvePete O'Hanlon12-Oct-16 4:59 
GeneralRe: HTML.Kendo.ComboBox [Error: Object doesn't support property or method 'requestData'] Pin
NotPolitcallyCorrect12-Oct-16 5:47
NotPolitcallyCorrect12-Oct-16 5:47 
QuestionI have a search button and datagrid in c# and SQL Pin
antonio_dsanchez11-Oct-16 11:16
antonio_dsanchez11-Oct-16 11:16 
AnswerRe: I have a search button and datagrid in c# and SQL Pin
Dave Kreskowiak11-Oct-16 11:23
mveDave Kreskowiak11-Oct-16 11:23 
AnswerRe: I have a search button and datagrid in c# and SQL Pin
antonio_dsanchez11-Oct-16 11:31
antonio_dsanchez11-Oct-16 11:31 
GeneralRe: I have a search button and datagrid in c# and SQL Pin
Swinkaran11-Oct-16 16:00
professionalSwinkaran11-Oct-16 16:00 
GeneralRe: I have a search button and datagrid in c# and SQL Pin
Pete O'Hanlon11-Oct-16 20:35
mvePete O'Hanlon11-Oct-16 20:35 
QuestionClosest standard value Pin
Pavlex410-Oct-16 10:44
Pavlex410-Oct-16 10:44 
AnswerRe: Closest standard value Pin
Pete O'Hanlon10-Oct-16 19:31
mvePete O'Hanlon10-Oct-16 19:31 
GeneralRe: Closest standard value Pin
Pavlex410-Oct-16 23:38
Pavlex410-Oct-16 23:38 
Rant[REPOST] Closest standard value Pin
Richard Deeming11-Oct-16 2:14
mveRichard Deeming11-Oct-16 2:14 
AnswerRe: Closest standard value Pin
Ralf Meier11-Oct-16 21:02
mveRalf Meier11-Oct-16 21:02 
GeneralRe: Closest standard value Pin
Pavlex423-Oct-16 8:43
Pavlex423-Oct-16 8:43 
QuestionAndroid Studio: How can disable My applications in mobile when i run my application? Pin
Dr Kasa10-Oct-16 3:54
Dr Kasa10-Oct-16 3:54 
AnswerRe: Android Studio: How can disable My applications in mobile when i run my application? Pin
Pete O'Hanlon10-Oct-16 4:11
mvePete O'Hanlon10-Oct-16 4:11 
AnswerRe: Android Studio: How can disable My applications in mobile when i run my application? Pin
OriginalGriff10-Oct-16 4:11
mveOriginalGriff10-Oct-16 4:11 
GeneralRe: Android Studio: How can disable My applications in mobile when i run my application? Pin
Eddy Vluggen10-Oct-16 4:38
professionalEddy Vluggen10-Oct-16 4:38 
GeneralRe: Android Studio: How can disable My applications in mobile when i run my application? Pin
OriginalGriff10-Oct-16 4:42
mveOriginalGriff10-Oct-16 4:42 
GeneralRe: Android Studio: How can disable My applications in mobile when i run my application? Pin
Eddy Vluggen10-Oct-16 5:02
professionalEddy Vluggen10-Oct-16 5:02 
GeneralRe: Android Studio: How can disable My applications in mobile when i run my application? Pin
OriginalGriff10-Oct-16 5:53
mveOriginalGriff10-Oct-16 5:53 
QuestionLong Path Exception when adding attachments Pin
NJdotnetdev10-Oct-16 3:00
NJdotnetdev10-Oct-16 3:00 
I am getting a long path exception while adding attachments to MailMessage. Our file path exceeds 260, but that's how it is and we want it to work.

Following is what I have done to avoid the exception:
C#
private void CreateAttachments(MailMessage mailMessage, List<string> filesToAdd)
        {
            foreach (string fileToAdd in filesToAdd)
            {
                SafeFileHandle fileHandle = null;
                try
                {
                    fileHandle = Common.CreateFile(Common.prefixPath(fileToAdd), Common.GENERIC_READ, FileShare.Read, IntPtr.Zero, FileMode.Open, 0, IntPtr.Zero);
                    if (!fileHandle.IsInvalid)
                    {
                        using (FileStream fs = new FileStream(fileHandle, FileAccess.Read))
                        {
                            Attachment data = new Attachment(fs, fileToAdd);
                            mailMessage.Attachments.Add(data);
                        }
                    }
                }
                finally
                {
                    if ((fileHandle != null) || fileHandle.IsInvalid)
                        fileHandle.Dispose();
                }
            }
        }


Above LOC doesn't throw an exception while adding attachments. But, while sending(smtpClient.Send(mailMessage)) it throws an exception "Failure Sending Mail".

UPDATED CODE

modified 10-Oct-16 10:17am.

AnswerRe: Long Path Exception when adding attachments Pin
F-ES Sitecore10-Oct-16 3:16
professionalF-ES Sitecore10-Oct-16 3:16 
AnswerRe: Long Path Exception when adding attachments Pin
NJdotnetdev12-Oct-16 4:35
NJdotnetdev12-Oct-16 4:35 

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.