Welcome to the Dot Net Tech Community

Experience The Freedom To Share...

Tuesday, December 28, 2010

Generic List as return type in WCF

Dear Readers, One of the common problem in WCF is returning lists in the service. When we return a Lin our serivce and generate a proxy for that we will be seeing an array in the Proxy generated, this is because by default all the collections are interpreted as arrays.

solution is while creating proxy incluse /ct: in the ending along with the Name space for the list, which inturn will change the proxy make the return type as list.Please find the below mentioned systax for the SVCUtil.exe

svcutil.exe http://[SERVER]/[Namespace].[Service].svc?wsdl /ct:System.Collections.Generic.List`1
[Note: Do not excude `1 in the ending]

Monday, July 12, 2010

Merge Join SSIS

Using Merge join,
1. Add a ADO Net Source Configure it to a table or a view.
2. Add Merge Join
Fig 1
3. Connect boath of them using the gree connector. ref: Fig2


Fig 2.
4. Select Appropriate join, now when you try to edit the merge join, there will be an error Error: "Both inputs to this transformation must have upstream columns defined."
5. Now Add Sort in between boath, edit sort and select the columns.
6. Now Edit the Merge Join




7. Map the columns, Select the appropriate join type.
8. Click on ok, and Press F5. there you go. SSIS Merge Join is ready.

SSIs RecordSet Destination to DataTable in Script Task

Hi All,

Let us how to convert from RecordSet to DataTable

Variables _var;_var = Dts.Variables;
System.Data.Oledb.OledbDataAdapter da = new System.Data.Oledb.OledbDataAdapter();

DataTable dt;da.Fill(dt, _var["rsName"].value);

Thursday, June 24, 2010

Components of WCF

1. WCF?
WCF is a technology buit to develop distributed applications. let us discuss the mail components of WCF.
1.1. Contracts.
1.1.1 Service Contract
1.1.2 Operation Contract
1.1.3 Data Contract
1.1.4 Message Contract
1.1.5 Fault Contract
1.2. EndPoints.
1.2.1 Address
1.2.2 Binding
1.2.3 Contract


2. So.. What points that WCF Addresses..?
2.1. Web Services
2.2. Communiucation with in .Net applications
2.3. Distributed transactions
2.4. Support for WS* Specifications
2.5. MSMQ

So by now we got to know some of the fundamentals for WCF.
Now let me ask a question. How would you implement all the concepts which are listed in point 2nd point. Your answer would be
"I will develop three different applications
1. Web Services and WS*, "
2. Communiucation with in .Net applications
3. MSMQ
We all are pretty much confident that all these concepts are technically feseable to implement in .Net 2.0, but what if I tell you you can implement all these concepts with in a single application, and access all these concepts parlally....?
Impressive right.. YES.. WCF is the answer for all these technologies with a single pice of code, just by configuring different end points in the WCF you can implement your code for all the technologies listed above.
With this I conclude, please post your queries.. and I'll try to address all of them.

Monday, June 21, 2010

Embeding Images in Custom Control

Steps to embed images in a custom control (.dll)
1. Adding Images to the solution.
Add images to the soution.
Right click the image and set the Build action to "Embeded Resource".
2. Declaring the image to be a web resource
Add the following line to the assemblyinfo.cs
[assembly: WebResource(".[folder].", "image/gif")]
3. Access the file in the code
Page.ClientScript.GetWebResourceUrl(this.GetType(), ".[folder].");
Done... you can now embed the images, .js files or .css files to the dlls.
This article also appears on Experts Exchange Embeded Resources in dlls