17 April 2008

Short and Sweet "Silverlight 2.0, LINQ and WCF in 5 Minutes" Video

Download Source

 

This is the first video in my new "Short and Sweet" video series. I'm going to continue with Silverlight, LINQ and WCF path for the series. Please ping me if you have an idea for a future video.

 

This video takes you through the minimum for building a Silverlight 2.0, LINQ and WCF data driven web app.

 

Prereqs:

Silverlight 2.0, http://silverlight.net

Visual Studio 2008

AdventureWorks DB

 

Here are the steps the video follows.

1) Install AdventureWorks Databases from:

http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004

AdventureWorksDB.msi

Attach DB using SQL Management Studio

2) Create new Silverlight Project with WebApp

3) Add LINQ to SQL Classes

4) Drag Contact class onto designer

5) Set Serialization Mode to Unidirectional

6) Add WCF Service item

7) Change binding to basicHttpBinding

8) Create GetContacts method in Interface and in class.

9) Add service reference to Silverlight Project.

10) Add DataGrid to Page.xaml

11) Set DataGrid x:Name

12) Set AutoGenerateColumns to true

13) Add Page.Loaded EventHandler

14) Add Completed EventHandler

15) Bind results to grid

16) Run app

Filed under: , , , , , ,
 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Microsoft news and tips » Short and Sweet “Silverlight 2.0, LINQ and WCF in 5 Minutes” Video said:

PingBack from http://microsoftnews.askpcdoc.com/?p=3074

17 April 08 at 1:12 PM
# Rick said:

Hello,

I'm new to C# and Linq, I'm getting this error when I debug the app, please help...

Rick

System.ServiceModel.CommunicationException was unhandled by user code

 Message="An error occurred while trying to make a request to URI 'http://localhost:23956/Service1.svc'. This could be due to a cross domain configuration error. Please see the inner exception for more details."

 StackTrace:

      at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)

      at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)

      at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)

      at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)

      at SilverlightApplication5.ServiceReference1.Service1Client.Service1ClientChannel.EndGetContacts(IAsyncResult result)

      at SilverlightApplication5.ServiceReference1.Service1Client.SilverlightApplication5.ServiceReference1.IService1.EndGetContacts(IAsyncResult result)

      at SilverlightApplication5.ServiceReference1.Service1Client.OnEndGetContacts(IAsyncResult result)

      at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)

 InnerException: System.Security.SecurityException

      Message=""

      StackTrace:

           at System.Net.AsyncHelper.BeginOnUI(BeginMethod beginMethod, AsyncCallback callback, Object state)

           at System.Net.BrowserHttpWebRequest.BeginGetResponse(AsyncCallback callback, Object state)

           at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteSend(IAsyncResult result)

           at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnSend(IAsyncResult result)

      InnerException: System.Security.SecurityException

           Message="Security error."

           StackTrace:

                at MS.Internal.InternalWebRequest.Send()

                at System.Net.BrowserHttpWebRequest.BeginGetResponseImplementation()

                at System.Net.BrowserHttpWebRequest.InternalBeginGetResponse(AsyncCallback callback, Object state)

                at System.Net.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__3(Object sendState)

           InnerException:

27 June 08 at 3:55 AM
# Frank Patton said:

can get the app to work and cant get sound on the video

07 August 08 at 5:18 PM
# Frank Patton said:

cant get app to run and cant get video sound .. can you download video?

07 August 08 at 5:19 PM
# jongallant said:

Frank,

Can you get it to compile?

The video doesn't include audio.  The next one will have audio....just didn't have a mic at the time.

Jon

07 August 08 at 5:25 PM
# jongallant said:

Rick - Are you accessing the service from your localhost?

You usually don't get that error unless you are going cross domain.

If you want, feel free to send me your solution and I'll have a look.

jong@microsoft.com

Thanks,

Jon

07 August 08 at 5:28 PM

Leave a Comment

Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Page view tracker