Tuesday, June 22, 2010

connect silverlight with ms sql server

No comments:
1. File->New Silverlight Application  and name, say “silverlight_wcf_sql”
2. Check the checkbox to host the silverlight application in a new web application “silverlight_wcf_sql.Web”
3. Silverlight page design
xaml_design
4. Add a new WCF Service and name it sql_wcf.svc
5. Add a method say “GetName()” like

[OperationContract]
public string GetName()
{
//refer attached file
}

OperationContract attribute above the method name indicates that this method can be called from a WCF client.
  • Refer the sample project attached.
6. Right click the Silverlight Application “silverlight_wcf_sql” and add Service Reference. Add “sql_wcf.svc” as Service Reference and name it “Silverlight_wcf_service_reference”
7. Go to MainPage.xaml and double click the button to generate BtnClickMe_Click event and type the code

private void BtnClickMe_Click(object sender, RoutedEventArgs e)
{
BtnClickMe.IsEnabled = false;
Silverlight_wcf_service_reference.sql_wcfClient myclient = new Silverlight_wcf_service_reference.sql_wcfClient();
myclient.GetNameCompleted += new EventHandler(myclient_GetNameCompleted);
myclient.GetNameAsync();
txtBlkSQL.Text = "Receiving data...";
LbMessage.Content = "http://www.rodriguesjax.blogspot.com";
}


void myclient_GetNameCompleted(object sender, Silverlight_wcf_service_reference.GetNameCompletedEventArgs e)
{
txtBlkSQL.Text = (string)e.Result;
BtnClickMe.IsEnabled = true;
}


Click here to download silverlight_wcf_sql.rar
use visual studio 2010

Sunday, June 20, 2010

Global hotkeys for windows media player

No comments:

Use media player just like Winamp.. use global hotkeys to control media player even when it is no longer in focus or it is minimized.

Install the plug-ins ‘Wmpkeys’. To customize go to options->Plug-ins and select the category Background. Then click Properties button to customizing its settings.

Hide windows live messenger icon or windows live mail icon to system notification

1 comment:

Hi, its easy to send the task bar icon of windows live mail or windows messenger to system notification area..

  1. Right click the program shortcut icon in All programs in start menu.
  2. Click Properties –> Compatibility tab
  3. use Compatibility mode for ‘Windows Vista (Service Pack 2) and click OK.
  4. Now open the program as usual and right click the icon in notification area.
  5. Check the option ‘Hide window when minimized’ and for messenger the there is no need of step 5.
  • Now you can see the program running in background just like in Windows Vista.