Friday, June 12, 2009

Windows 7, VMWare Graphic problem and solution

I have Vista X64 SP2 as my main machine {P8400, 6GB, 9800GT 1GB, 320GB x 2, 1 DVI Port}

Software In Question: Visual Studio 2010 B1 10.0.20506.1, VMWare Workstation 6.5.1.126130

I have Windows 7 Build 7100 from MSDN on my VMWare. There is some problem with graphics. The VMWare comes with SVGA II graphic driver but it does not seem like doing its job properly. Tools bars and some components cannot be seen when DirectX 9.0c acceleration is enabled on VMWare. I have turned off all graphic options for the best performance on Windows 7. However, it doesn't seem to improve even at 16bit graphic mode.

The solution I came up with is to open Windows 7 remote and access Widows 7 from Remote Desktop Connection.

On Windows 7 and IE8, JavaScript seems to work faster, almost as fast as on Chrome. I recently developed drag-and-drop elements on one of my aspx pages and on IE8, the elements seem to drag bit slower. However, on Chrome, the element moves flawlessly. I need to tune the UI element to move faster since most people still have IE7.

Anyway, accessing Windows 7 from the native window client's RDC seems to work well. I suspect this is because the RCD uses native graphic card driver instead of simulated driver on VMWARE. VMWARE should be updating its workstation soon.

Friday, June 5, 2009

Databind XML to Gridview

string location = @"somefilename";

System.Data.DataSet oDS = new System.Data.DataSet();

oDS.ReadXml(location);

gvIcons.DataSource = oDS;

gvIcons.DataBind();

Monday, June 1, 2009

BlackBerry 9530 Update

BlackBerry 9530 Update. [ .75 to .148 ] on Verizon Wireless

I have waited for months for some significant update that would ameliorate BlackBerry Storm. It is finally here.

I was not able to use OTA to update my device. The process kept warning me about the lack of memory. Therefore, I updated BlackBerry through the BlackBerry Update Site.

When I update the device, it wiped out everything. Que Lastima. So, I had to reload all my apps.

I’ve been using it for now 2 hours, UI is faster and smoother. On Portrait Mode, a QWERTY keyboard layout is available. However, due to my fat fingers, I cannot use it. It is for the stylish on a non-stylish phone, kinky indeed.

So far, I have downloaded two themes, google apps, and few others, I have 36.1MB memory available. I installed a cool KDE theme. Enjoy.

Friday, April 3, 2009

How to Properly Declare Enumeration

When delcaring the enumration in C#, you need an attribute [Flags]. Every element should have associated numeric value. There should be the None = 0 as well, and FxCop gives an warning if this part is missing.

[Flags]
public enum AttachmentTypes

{

None = 0,

Image = 1,

Video = 2,

Sound = 3,

Excel = 4,

Word = 5,

PowerPoint = 6,

Text = 7,

Xml = 8,

Application = 9,

Zip = 10,

Rar = 11,

Json = 12

}

Monday, March 9, 2009

Setup Multiple WCF Service Reference Part 1

This is how I have setup a multiple "Services" (Interfaces) within in a single host.  Way I understand the WCF is that it acts as a virtual .Dll.  As such, you can practically place every routine in the WCF space.  

Scenarios:

public
class
Service1 : IService1

{


public Service2 Service2 { get; set; }


public Service3 Service3 { get; set; }


public Service4 Service4 { get; set; }

}

You want to able to do some routines that are required by Service2..4.   Let's say that each one of them has (add/update, delete, get) functions.  You could insert them into the IService1.  However, you would have too many methods.  So, I thought of creating separate services for separate classes.  I am sure there are better ways.  I do not know the better ways as of today (03/05/2009).  I have not been able to use generics or something bit clever or elegant.

This is what I came up for my self-technical constraints.

<system.serviceModel>

<bindings />

<services>

<service
behaviorConfiguration="WCFLibrary.Service1Behavior"


name="WCFLibrary.MyService">

<clear />

<endpoint
binding="wsHttpBinding"
contract="WCFLibrary.IService1"


listenUriMode="Explicit">

<identity>

<dns
value="localhost" />

identity>

endpoint>

<endpoint
address="mex"
binding="mexHttpBinding"
name="mex"
contract="IMetadataExchange" />

<host>

<baseAddresses>

<add
baseAddress="http://localhost:8080/MyService1" />

</baseAddresses>

</host>

</service>

<service
behaviorConfiguration="WCFLibrary.Service1Behavior"


name="WCFLibrary.MyService2">

<endpoint
address=""
binding="wsHttpBinding"
bindingConfiguration=""


contract="WCFLibrary.IService2" />

<endpoint
address="mex"
binding="mexHttpBinding"
name="mex"
contract="IMetadataExchange" />

<host>

<baseAddresses>

<add
baseAddress="http://localhost:8080/MyService2" />

</baseAddresses>

</host>

</service>

<service
behaviorConfiguration="WCFLibrary.Service1Behavior"


name="WCFLibrary.MyService3">

<endpoint
address=""
binding="wsHttpBinding"
bindingConfiguration=""


contract="WCFLibrary. IService3" />

<endpoint
address="mex"
binding="mexHttpBinding"
name="mex"
contract="IMetadataExchange" />

<host>

<baseAddresses>

<add
baseAddress="http://localhost:8080/MyService3" />

</baseAddresses>

</host>

</service>

<service
name="WCFLibrary.MyService4"
behaviorConfiguration="WCFLibrary.Service1Behavior">

<endpoint
address=""
binding="wsHttpBinding"
bindingConfiguration=""


contract="WCFLibrary.IService4" />

<endpoint
address="mex"
binding="mexHttpBinding"
name="mex"
contract="IMetadataExchange" />

<host>

<baseAddresses>

<add
baseAddress="http://localhost:8080/MyService4" />

</baseAddresses>

</host>

</service>

</services>


 

<behaviors>

<serviceBehaviors>

<behavior
name="WCFLibrary.Service1Behavior">

<serviceMetadata
httpGetEnabled="true" />

<serviceDebug
includeExceptionDetailInFaults="false" />

</behavior>

</serviceBehaviors>

</behaviors>

</system.serviceModel>

Wednesday, March 4, 2009

WCF "The target assembly contains no service types"

WCF Error

"The target assembly contains no service types.  You may need to adjust the Code Access Security policy of this assembly."


 

This is because you have left out your WCF interface.


 

If you have a IWebService.cs and a WebService.cs...  that does WebService: IWebService but for whatever reason you took out the IWebService... like I have done before.. you will get this error.


 

The answer is to put that back in.  You can create interface from your class from class diagram.  Use class diagram almost all the time.  It is very good tool to engineer your code.  It is a must.


 

On the web, there was a suggestion of taking out  {3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} from your project file..Don't do it.  I think these are the paired Guid for the WS client and the WS host.  I could be wrong.


 

Good luck.

Thursday, February 12, 2009

Sys.WebForms.PageRequestmanagerServerErrorException


Sys.Webforms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

I was getting this error when I clicked on an object that's inside the UpdatePanel.

The solution was to ..

EnablePartialRendering="true" to "false"

<asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release" EnablePartialRendering="true">


to 

<asp:ScriptManager ID="ScriptManager1" runat="server" 
ScriptMode="Release"EnablePartialRendering="false">