protected void btnSend_Click(object sender, EventArgs e) { // create a new entry in table storage MessageBoardEntry entry = new MessageBoardEntry() { GolferName = txtName.Text, GolferMessage = txtMessage.Text }; MessageBoardDataSource ds = new MessageBoardDataSource(); ds.AddEntry(entry); txtName.Text = ""; txtMessage.Text = ""; dlMessages.DataBind(); }
//The AddMessageBoardEntry method inserts new entries into the table. public void AddEntry(MessageBoardEntry newItem) { TableServiceContext tableServiceContext = tableClient.GetDataServiceContext(); tableServiceContext.AddObject(messageTableName, newItem); tableServiceContext.SaveChanges(); }