Click here to Skip to main content
15,923,374 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do I get images without using picturebox? Pin
OriginalGriff14-Apr-15 4:35
mveOriginalGriff14-Apr-15 4:35 
GeneralRe: How do I get images without using picturebox? Pin
Pete O'Hanlon14-Apr-15 4:54
mvePete O'Hanlon14-Apr-15 4:54 
GeneralRe: How do I get images without using picturebox? Pin
OriginalGriff14-Apr-15 4:59
mveOriginalGriff14-Apr-15 4:59 
AnswerRe: How do I get images without using picturebox? Pin
Mycroft Holmes14-Apr-15 14:25
professionalMycroft Holmes14-Apr-15 14:25 
QuestionDLMS examples in C# Pin
stevenson.john8013-Apr-15 16:34
stevenson.john8013-Apr-15 16:34 
AnswerRe: DLMS examples in C# Pin
Black_Rose13-Apr-15 21:26
Black_Rose13-Apr-15 21:26 
QuestionAdd and update a record using Linq and Entity Pin
jkirkerx13-Apr-15 9:58
professionaljkirkerx13-Apr-15 9:58 
AnswerIt works, not sure if its correct or not Pin
jkirkerx13-Apr-15 12:10
professionaljkirkerx13-Apr-15 12:10 
I wrote the delete record, and figured update was similar in code.
I'm sure about the return value from save, it the int is the record added or if 1 = added successfully, and 0 = updated successfully
private int data_Save(Guid pValue)
{
    int dwRCode = 2;

    // Fetch the Data, and write it to the Customer
    string m_businessName = BusinessNameTextBox.Text.Trim();
    string m_firstName = firstNameTextBox.Text.Trim();
    string m_lastName = lastNameTextBox.Text.Trim();                    

    StoreContext context = new StoreContext();
    if (Guid.Empty == pValue)
    {
        Customer c = new Customer
        {
            BusinessName = m_businessName,
            FirstName = m_firstName,
            LastName = m_lastName
        };   

        // Insert the new record in Customers
        context.Customers.Add(c);
        dwRCode = context.SaveChanges(); // returns 1 if successful, ? if failed
    }
    else
    {
        // Update the record in Customers
        var customer = context.Customers.Where(i => i.ID == pValue).FirstOrDefault();
        if (customer != null)
        {
            context.Customers.Attach(customer);

            customer.BusinessName = m_businessName;
            customer.FirstName = m_firstName;
            customer.LastName = m_lastName;

            dwRCode = context.SaveChanges(); // returns 0 if successful, ? if failed<br />
        }                 

    }
    return dwRCode;
}

QuestionPrinting graphics in C# with sizes in mm Pin
Member 1050678613-Apr-15 8:21
Member 1050678613-Apr-15 8:21 
AnswerRe: Printing graphics in C# with sizes in mm Pin
OriginalGriff13-Apr-15 8:26
mveOriginalGriff13-Apr-15 8:26 
Questionpassing a value that maybe null to a dialog form Pin
jkirkerx13-Apr-15 8:13
professionaljkirkerx13-Apr-15 8:13 
AnswerRe: passing a value that maybe null to a dialog form Pin
OriginalGriff13-Apr-15 8:22
mveOriginalGriff13-Apr-15 8:22 
GeneralRe: passing a value that maybe null to a dialog form Pin
jkirkerx13-Apr-15 8:41
professionaljkirkerx13-Apr-15 8:41 
QuestionENVDTE2 Question Pin
Kevin Marois13-Apr-15 8:03
professionalKevin Marois13-Apr-15 8:03 
QuestionTree class recommendation Pin
DaveyM6913-Apr-15 6:05
professionalDaveyM6913-Apr-15 6:05 
AnswerRe: Tree class recommendation Pin
Eddy Vluggen13-Apr-15 8:58
professionalEddy Vluggen13-Apr-15 8:58 
GeneralRe: Tree class recommendation Pin
DaveyM6913-Apr-15 12:46
professionalDaveyM6913-Apr-15 12:46 
GeneralRe: Tree class recommendation Pin
Eddy Vluggen13-Apr-15 12:54
professionalEddy Vluggen13-Apr-15 12:54 
GeneralRe: Tree class recommendation Pin
BillWoodruff13-Apr-15 14:20
professionalBillWoodruff13-Apr-15 14:20 
GeneralRe: Tree class recommendation Pin
BillWoodruff13-Apr-15 13:22
professionalBillWoodruff13-Apr-15 13:22 
GeneralRe: Tree class recommendation Pin
Eddy Vluggen13-Apr-15 21:51
professionalEddy Vluggen13-Apr-15 21:51 
GeneralRe: Tree class recommendation Pin
DaveyM6914-Apr-15 8:26
professionalDaveyM6914-Apr-15 8:26 
GeneralRe: Tree class recommendation Pin
Eddy Vluggen14-Apr-15 9:02
professionalEddy Vluggen14-Apr-15 9:02 
AnswerRe: Tree class recommendation Pin
Mycroft Holmes13-Apr-15 14:29
professionalMycroft Holmes13-Apr-15 14:29 
Questionc# and xml Pin
Sandeep Puvvadi13-Apr-15 1:47
Sandeep Puvvadi13-Apr-15 1:47 

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.