Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6937365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:21:13+00:00 2026-05-27T12:21:13+00:00

I am working a sample application using Windows Azure table storage. I will try

  • 0

I am working a sample application using Windows Azure table storage. I will try to explain it using some code:

//GetStudent is a service call
StudentDetails student = this.GetStudent(studentID);

This code returns me a StudentDetails object with both PartitionKey and RowKey as null since both of those are not DataMembers in my DataContract.

//Update the student object
student.LastName = "New Last Name";
this.UpdateStudent(student);//Another service call

My update service code looks like below:

context.AttachTo(StudentDataServiceContext.studentTableName, student, "*");
context.UpdateObject(student);
context.SaveChangesWithRetries(SaveChangesOptions.ReplaceOnUpdate);

When I run this code I get the below error:

One of the request input is not valid

I did find a workaround to solve this and updated the UpdateService code like below:

StudentDetails temp = (from c in context.StudentTable
                       where c.PartitionKey == "Student" && c.RowKey == student.ID
                       select c).FirstOrDefault();
//Copy each and every property from student object to temp object
temp.LastName = student.LastName;
context.UpdateObject(temp);
context.SaveChangesWithRetries(SaveChangesOptions.ReplaceOnUpdate);

This works fine and the object gets updated in the table storage.

But is there not a better way of doing this? Why doesn’t the AttachTo function work in my case?

EDIT

Just to make my question more clear, here is my StudentDetails Class:

[DataContract]
public class StudentDetails
{
        public string PartitionKey { get; set; }
        public string RowKey { get; set; }

        [DataMember]
        public string First Name { get; set; }

        [DataMember]
        public string Last Name { get; set; }

        [DataMember]
        public string ID { get; set; }
}

And below is my GetStudent method:

BasicHttpBinding myBinding = new BasicHttpBinding();
EndpointAddress myEndpoint = new EndpointAddress(RoleEnvironment.GetConfigurationSettingValue("StudentServiceURI"));
ChannelFactory<IPatientService> myChannelFactory = new ChannelFactory<IStudentService>(myBinding, myEndpoint);
IStudentService proxy = myChannelFactory.CreateChannel();
student = proxy.GetPatient(studentID);
((IClientChannel)proxy).Close();
myChannelFactory.Close();

I feel the problem is with my GetStudent’s channel factory call which is missing something related to service’s context. I just don’t know what.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:21:14+00:00Added an answer on May 27, 2026 at 12:21 pm

    You said that the Student object returned doesn’t have a PartitionKey and RowKey set when it is returned. You then try to update that object. If you haven’t set the PartitionKey and RowKey yourself before calling .Update() this will fail as the underlying REST API depends on these.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are creating sample application for windows mobile using Rijndael algorithm. Its working fine.
I am working with Windows Azure and am just using the Blob Storage. I
I am working on a simple chat application using a System.Windows.Forms.WebBrowser Control to display
I am working on a small windows application. The application needs to show some
I'm developing a windows forms application using VB.NET. I'm currently working on DataReport (by
I am currently working on a simple web application through Google App engine using
I am currently working on a sample application which uses QNetworkAccessManager to send the
I am working with the sample Home application project on http://developer.android.com/resources/samples/Home/index.html I've added another
I'm working with a C# sample application (taken from here : http://www.piccoder.co.uk/content/view/42/26/1/4/ ) The
I have created an OData/WCF service using Visual Studio 2010 on Windows XP SP3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.