Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

Practical No: 7 Understanding and Creating Table storage in Windows

Azure for Cloud services.


Creating a project nae: aan
Add new project to e!isting project
"elete t#e file class$.cs .T#en add t#e new class aan%entit&
Add web role:
deepi%entit&.cs
naespace aan%data
'
public class deepi%entit&:(icrosoft.WindowsAzure.)torageClient.Table)ervice*ntit&
'
public aan%entit&+,
'

-
-
-
Add new file aan%datasource
Add new connection string
Add web role:
Coding:
using )&ste.
using )&ste.Collections./eneric.
using )&ste.0in1.
using )&ste.Te!t.
using )&ste.T#reading.Tas2s.
using (icrosoft.WindowsAzure.
using (icrosoft.WindowsAzure.)torageClient.
using (icrosoft.WindowsAzure.)ervice3untie.
naespace deepi%data
'
public class aan%datasource
'
public aan%datasource+,
'
string conn 4 3ole*nvironent./etConfiguration)etting5alue+6connection6,.
Cloud)torageAccount ca 4 Cloud)torageAccount.Parse+conn,.
CloudTableClient tc 4 ca.CreateCloudTableClient+,.
ca.CreateCloudTableClient+,.CreateTable7fNot*!ist+6aan6,.
Table)erviceConte!t tab 4 tc./et"ata)erviceConte!t+,.
aan%entit& entit& 4 new aan%entit&+,.
entit&.Partition8e& 4 6aan6.
entit&.3ow8e& 4 6deep6.
tab.Add9bject+6aan6: entit&,.
tab.)aveC#anges+,.
-
-
-
"*;AU0T.A)P<
5iew Code

Add Web 3ole
default.asp!.cs
using )&ste.
using )&ste.Collections./eneric.
using )&ste.0in1.
using )&ste.Web.
using )&ste.Web.U7.
using )&ste.Web.U7.WebControls.
using aan%data.
naespace Web3ole$
'
public partial class %"efault : Page
'
protected void Page%0oad+object sender: *ventArgs e,
'
aan%datasource ds 4 new aan%datasource+,.
-
-
-

You might also like