Skip to content

Instantly share code, notes, and snippets.

private async void UpdateButton_Click(object sender, RoutedEventArgs e)
{
try
{
if (FolderBox.SelectedItem != null)
{
Dictionary<string, object> updatefolder = new Dictionary<string, object>();
updatefolder.Add("name", "updatefolder");
//PutAsync中傳入要更新的資料夾ID
LiveOperationResult operationresult = await liveClient.PutAsync((FolderBox.SelectedItem as ListBoxItem).Tag.ToString(), updatefolder);
private async void DeleteButton_Click(object sender, RoutedEventArgs e)
{
try
{
if (FolderBox.SelectedItem != null)
{
//DeleteAsync中傳入要刪除的資料夾ID
LiveOperationResult operationresult = await liveClient.DeleteAsync((FolderBox.SelectedItem as ListBoxItem).Tag.ToString());
MessageDialog msg = new MessageDialog("Folder deleted");
await msg.ShowAsync();
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Microsoft.Live;
using Windows.UI.Popups;
using System.Collections.Generic;
namespace LiveSDKSample
{
public sealed partial class MainPage : Page
<Page.BottomAppBar>
<CommandBar>
<CommandBar.PrimaryCommands>
<AppBarButton Label="Emoji2" Icon="Emoji2"/>
</CommandBar.PrimaryCommands>
<CommandBar.SecondaryCommands>
<AppBarButton Label="Like" Icon="Like"/>
</CommandBar.SecondaryCommands>
</CommandBar>
</Page.BottomAppBar>
public MainPage()
{
this.InitializeComponent();
this.Loaded += MainPage_Loaded;
}
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
SearchBox.Focus(FocusState.Programmatic);
}
CREATE TRIGGER [dbo].[NumTrigger]
ON [dbo].[testTable]
FOR UPDATE
AS
BEGIN
print 'begin trigger'
if UPDATE(Num)
BEGIN
DECLARE @num int
select @num=Num from inserted
CREATE PROCEDURE [dbo].[sp_Test1]
@table1_Id INT OUTPUT
AS
begin try
begin transaction
print 'sp_Test1:executing sp_Test2'
exec sp_Test2 @table1_Id output
print 'sp_Test1:executing sp_Test3'
exec sp_Test3
print 'commit tran'
CREATE PROCEDURE [dbo].[sp_Test2]
@table1_Id INT OUTPUT
AS
print 'sp_Test2:insert'
insert into testTable1 values('col1')
select @table1_Id = @@IDENTITY
CREATE PROCEDURE [dbo].[sp_Test3]
AS
begin try
print 'sp_Test3:updating'
update testTable2 set Num=6 where Id=2
print 'sp_Test3:updated'
end try
begin catch
print 'sp_Test3:in catch'
RAISERROR('raiseerror:sp_Test3', 16, 1)
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApplication1"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TextBlock x:Name="textBlock" HorizontalAlignment="Left" Height="47" Margin="110,63,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Width="159"/>