Saturday, July 21, 2012

Microsoft SharePoint Server 2013 Preview is Released

This week Microsoft has unveiled SharePoint Server 2013 Preview along with 2013 Preview versions of Exchange, Lync, Office Web Apps Server, Project, Visio and Office Professional Plus. All these previews brings a Metro-like feel, as well as revamped touch tools intended to make it easier to use the desktop applications on a tablet.

According to Microsoft SharePoint Team Blog, here is a list of new features which are available in this new release.
  1. New SharePoint Experience - Metro Style User Experience
  2. Pervasive Social Networking - Yammer and SharePoint
  3. SkyDrive Pro - Sync and use documents offline in the Windows Explorer
  4. SharePoint Sites - View sites in one place
  5. Projects for Everyone - Task management
  6. FAST Search and Recommendations - Search with FAST
  7. Cloud App Model and Marketplace - build, buy, deploy and manage applications via the new Cloud App Model for the Office 2013
  8. Dynamic Publishing - Multi-device, Multi-lingual intranet and internet sites
  9. In-Place Governance and Compliance - New unified policy management

I have installed SharePoint 2013 and the user experience is some what different when comparing to SharePoint 2010, but it is great. It’s like Windows 8 user experience. I think it will take some time to get familiar with this new release and I am pretty sure it is worth it.

Central Administration
Team Site

For more information on all the new 2013 product preview releases, visit Try more products page.

Happy Coding.

Regards,
Jaliya

Friday, July 20, 2012

Writing blog posts with Windows Live Writer

For all this time, I was using Blogger post editor to write my posts. It is a nice editor, but it has some difficulties when writing source codes. Today one of my good friends, Melick told me about this Windows Live Writer which comes with Windows Live Essentials.

I have Windows Live Essentials in my laptop for sometime and the funny thing is I did not know about this nice tool until today. Just now I started using it and I must say, it is the nicest blog editor I have ever seen. The capabilities of Windows Live Writer is really amazing and it has the ability to connect to almost any kind of blog and to do all the things related to a posts without touching the browser. And there are a lot of nice free plug-ins available to make your post writing time more enjoyable.

For those who haven’t started using Windows Live Writer, why not give it a try. I am sure you will like it. And Thank you so much Melick for showing me this nice tool.

Happy Coding.

Regards,
Jaliya

Tuesday, July 10, 2012

Connecting to an Instance of SQL Server by Using SQL Server Authentication in C#

I am pretty sure that you can find many articles about how to connect to a specific database on a SQL Server instance in C#. But you won't be able to find many about how to connect to a specific SQL Server instance in C#. So thought to write a post about how to connect to a SQL Server Instance in C#.

Before starting off with the topic, I think it's better to refresh the knowledge in SQL Server instances.

Mainly there are two types of SQL Server instances. First is the Default Instance which is identified solely by the name of the computer on which the instance is running, it does not have a separate instance name. The second is the Named Instance. All instances of the database engine other than the default instance are identified by an instance name specified during installation of the instance. We can only have one default instance, but we can have many named instances and each SQL Server instance has its own copy of the server files, databases and security credentials.

Now let's move into the topic. We can connect to a SQL Server instance using SQL Server Management Objects (SMO). SMO is a collection of objects that are designed for programming all aspects of managing Microsoft SQL Server.

So this is how you can connect to the Default, Named and Remote Server Instances using SQL Server Authentication. First you need to add references to following dll's which can be found on "C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies" folder.
  1. Microsoft.SqlServer.Smo.dll
  2. Microsoft.SqlServer.ConnectionInfo.dll
  3. Microsoft.SqlServer.Management.Sdk.Sfc.dll
using System;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Common;

namespace ConnectToSQLInstance
{
class Program
{
static void Main(string[] args)
{
string username = "sa";
string password = "sa";
string instanceName = "instance_name";
string remoteSrvName = "remote_server_name";

/*----------------connect to default instance----------------*/
Server oServer = new Server();
// set to true for Windows Authentication
oServer.ConnectionContext.LoginSecure = false;
oServer.ConnectionContext.Login = username;
oServer.ConnectionContext.Password = password;
// connection is established
Console.WriteLine(oServer.Information.Version);

/*----------------connect to named instance----------------*/
ServerConnection oServerConnection = new ServerConnection();
// connects to named instance
oServerConnection.ServerInstance = @".\" + instanceName;
oServerConnection.LoginSecure = false;
oServerConnection.Login = username;
oServerConnection.Password = password;
Server oServerNamed = new Server(oServerConnection);
// connection is established
Console.WriteLine(oServerNamed.Information.Version);

/*----------------connect to default instance----------------*/
// In here remote server name / ServerInstance needs to be specified
ServerConnection oRemoteServerConnection = new ServerConnection(remoteSrvName);
oRemoteServerConnection.LoginSecure = false;
oRemoteServerConnection.Login = username;
oRemoteServerConnection.Password = password;
Server oServerRemote = new Server(oRemoteServerConnection);
// connection is established
Console.WriteLine(oServerRemote.Information.Version);
}
}
}
Hope this helps.

Happy Coding.

Regards,
Jaliya

Friday, July 6, 2012

MS SQL Server table browser and a Stored Procedure Generator

Isn't it nice to have some simple tool which will allow you to easily browse through your connected MS SQL Servers' all databases and tables? And then view the table information in design mode such as column names, column types, column sizes and primary keys etc? And finally to create "INSERT", "UPDATE", "DELETE" and "SELECT" stored procedures for a selected table in a single button click?

Since I am little bit lazy in doing things related to MS SQL, I wanted an application to make my life easier when writing Stored Procedures and all. So I have wrote this simple tool, in which it's main task is to generate Stored Procedures which ultimately ended up as a "MS SQL Server table browser and a Stored Procedure Generator".

This tool has the ability to connect to default, named or remote instances of SQL Server database engine. (Please note that, only the SQL Server Authentication is supported in this version.)  Then it can be used to browse databases and tables of connected SQL Server instance and then to view tables design in an easier manner. And finally it has the capability to generate  "INSERT", "UPDATE", "DELETE" and "SELECT" stored procedures for a selected table.


Connect To Server

Database and Table Browser

Table Design Viewer

Stored Procedure Generator


I have uploaded the installer to my skydrive, so anyone can help themselves with this tool. I have ran couple of tests with generated stored procedures and the results were very much satisfying. But if you come across with any kind of bug, please let me know as I am planning to enhance this tool further. It is really appreciated.

     Download

Happy Coding.

Regards,
Jaliya

Tuesday, July 3, 2012

How to open a new browser window from the code behind file - ASP.NET & C#

Sometimes we face this situation where we want to fill some values into some variables and we want to send those values to a web page where it will open in a new window. If you want to do all this in a single button click, there is something you should think about.

In javascript, there is window.open() method, which you  can use to open the new window in any way you prefer. But since that would be a client side event, it will run before the server side events. Which means if you write all the session variable assigning part in your server side click event which is,

OnClick
it will fire after executing client side click event which is,
OnClientClick
So as a solution to that, this is the code snippet to open a new window from the code behind file under the server side click event.
ClientScript.RegisterStartupScript(this.GetType(), "PopupWindow", "<script language='javascript'>window.open('YourPage.aspx','Title','width=600,height=300')</script>");
Happy Coding.

Regards,
Jaliya