Showing posts with label Visual Studio 2010. Show all posts
Showing posts with label Visual Studio 2010. Show all posts

Friday 31 August 2012

Installing SQL Server Data Tools (SSDT)

What is SQL Server Data Tools?

SQL Server Data Tools (SSDT) is a toolset which provides an integrated environment for database developers to carry out all their database design work for any SQL Server platform (both on and off premise) within Visual Studio. Database developers can use the SQL Server Object Explorer in VS to easily create or edit database objects and data, or execute queries.

More details are available regarding it’s features at http://blogs.msdn.com/b/ssdt/archive/2011/11/21/what-is-sql-server-data-tools-ssdt.aspx

SSDT is not intended to be a replacement for SSMS, but instead can be viewed much more as a greatly evolved implementation of DbPro. Indeed, SSMS is alive and well in SQL Server 2012, and it continues to serve as the primary management tool for database administrators who need to configure and maintain healthy SQL Server installations.

However SSDT does not get installed with either Visual Studio or SQL Server. Instead, SSDT ships separately via the Web Platform Installer (WebPI).

  1. Download SSDT from http://go.microsoft.com/fwlink/?LinkID=241405
  2. Once it’s downloaded, open a command window with administrative privileges (run cmd.exe as Administrator), and execute the following command :

SSDTSetup.exe /layout <destination>

<destination> is the path which the WebPI will download all the necessary installation files and create the administrative installation point. This can be a location in either LAN, USB or your Local Drive.

img_screen_01

Then it’ll start to download the required files to the given location.

img_screen_02

Once everything is downloaded you can execute the ‘SSDTSetup.exe’ from the destination location. (without any arguments). Once the installation is completed successfully, you can see the tool in Visual Studio 2010 development environment. Select it from the ‘View’ menu.

img_screen_04

img_screen_05

Friday 3 December 2010

Show properties of a class on Property Grid

When developing user controls, usually we use Booleans, Integers, Strings, etc.. as data types of the attributes of the control. But sometimes, we have to use structures or other classes as attributes. So when we use those, we should be able to change or browse the attributes of those structures or classes.

Open visual studio IDE and create a new Windows Forms Application type project.

Add a new class and name it as ‘MyCustomClass’. And define two properties. One integer and a string type.

public class MyCustomClass {

public int MyIntProperty { get; set; }
public string MyStringProperty { get; set; }

public override string ToString() {
return "...";
}
}







**Please note that I have overridden the ‘ToString’ method. Because this what will be shown on the property grid when the properties are collapsed.



Now add a new user control to the project and name it as ‘MyCutomUsercontrol’. And create three properties. One integer, string and MyCustomClass. And use ‘[TypeConverter(typeof(ExpandableObjectConverter))]’ attribute on the third property. The syntax should be:






public partial class MyCutomUsercontrol : UserControl {
public MyCutomUsercontrol() {
InitializeComponent();
}

private MyCustomClass _MyCustomClass = new MyCustomClass();

public int Property1 { get; set; }
public string Property2 { get; set; }

[TypeConverter(typeof(ExpandableObjectConverter))]
[EditorBrowsable(EditorBrowsableState.Always)]
public MyCustomClass Property3 {
get {
return _MyCustomClass;
}
set {
_MyCustomClass = value;
}
}

}





 



Now build the solution. And add it a windows form. And on the property grid you can see your custom controls properties.



screen_1

Thursday 25 November 2010

Disabling tab pages on a Tab Control

Sometimes there can be a requirement, which we have to prevent users from accessing certain tab pages on a tab control. But there’s no straight forward method provided on the Visual Studio IDE (2005,2008 or 2010). But we can do that easily.

Add a tab control to your windows application. (tabControl1)

Add few tabs and few controls to each tab.

img_01

Now we’ll disable one tab using the following code on the form’s load event:

tabControl1.TabPages[2].Enabled = false;


** Please note : Though it does not list the ‘Enabled’ property on intellisense, it’s available.


Now if you run the application you can see, that all the controls in tab page 3 are dissabled.


img_02




But if we want to prevent from users accessing that tab, we can use this coding on tab controls selecting event (Not the page, but the control’s)


private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
{
if (!e.TabPage.Enabled)
{
e.Cancel = true;
}
}


Now if you run the application and try to select that tab page, you will not be able to do so..

Sunday 2 May 2010

Visual Studio 2010 and Smart Device Development - Disappointing

Visual Studio 2010 does not support mobile application development for versions of Windows Phone prior to Windows Phone OS 7.0.

For information about using Visual Studio 2010 to create applications for Windows Phone OS 7.0, see Windows Phone Development and Silverlight for Windows Phone.

For Visual Studio 2008 mobile developers, Microsoft released the Windows Mobile 6.5 Developer Tool Kit, which works with the Windows Mobile 6 SDK.

Because Visual Studio 2010 does not support mobile application development for Windows Phone prior to Windows Phone OS 7.0, you cannot use the following features: .NET Compact Framework projects, Visual C++ device projects, smart device CAB projects, Device Emulator and Device Emulator Manager, testing tools for device projects, and Device Security Manager.

Mobile application development is still supported in earlier versions of Visual Studio, such as Visual Studio 2008. For more information about smart device projects, see Windows Mobile Developer Center and Smart Device Development in Visual Studio 2008.