コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: balaTest/CloudSamples
        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();
        }
コード例 #2
0
 //The AddMessageBoardEntry method inserts new entries into the table.
 public void AddEntry(MessageBoardEntry newItem)
 {
     TableServiceContext tableServiceContext = tableClient.GetDataServiceContext();
     tableServiceContext.AddObject(messageTableName, newItem);
     tableServiceContext.SaveChanges();
 }