Category Archives: Microsoft

ASP.Net Microsoft

asp.net button: Open a popup window after a button click

<asp:button runat="server" ID="button1"  Text="popup"  ></asp:Button>

vb sample:


Protected Sub button1_Click(sender As Object, e As System.EventArgs) Handles button1.Click

Dim sb As New StringBuilder()
sb.Append("<script>")
sb.Append("window.open('http://www.galhano.com', '', '');")
sb.Append("</script>")

Dim cstype As Type = Me.GetType()

Page.ClientScript.RegisterStartupScript(cstype,"test", sb.ToString())

End Sub

AJAX ASP.Net

Triggers in updatepanel (sample)

This sample shows how to trigger a updatepanel from a control outside of it:


<asp:UpdatePanel ID="uPanel1" runat="server" UpdateMode=Conditional >
<ContentTemplate>

<asp:TextBox ID="txtMyNumber" runat="server"></asp:TextBox>

<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID=uPanel1>
<ProgressTemplate>
<asp:Image ID="imgAjaxLoader" runat="server" ImageUrl="~/Icon/ajax-loader.gif"/> 
</ProgressTemplate>
</asp:UpdateProgress>

</ContentTemplate>

<Triggers>
<asp:AsyncPostBackTrigger ControlID ="btnUpdateMyNumber" />
</Triggers>

</asp:UpdatePanel>

<asp:Button  runat="server" ID="btnUpdateMyNumber" Text="Set My Number"  />

Microsoft SQL Server

How to enable remote Connection sql server 2008

Error message:

“A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)”

How to solve this issue?

There are a couple of things that might be going on here… (All of the following configurations are made on the computer running your SQL Server 2008 instance)

Allow remote connections to this server

The first thing you want to check is if Remote Connections are enabled on your SQL Server database. In SQL Server 2008 you do this by opening SQL Server 2008 Management Studio, connect to the server go to Properties -> Connections -> Check “Allow remote connections to this server”.

for further issues check  http://blogs.msdn.com/b/walzenbach

Microsoft SQL Server

Problem with Identity Specification in SQL…

Error message when changing the identity column to “Yes” and save the changes:

“Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table to be re-created.”

It’s not a bug. It’s a safety measure added to SQL 2008’s management studio to indicate that the change that you’ve requested to the table requires that the table be dropped and recreated.

It’s there so that people don’t ‘accidentally’ make changes in production that will take hours.

use “SET IDENTITY_INSERT” command, for more info, see SQL BOL.

Or turn off the warning under tools–>options–>designers–>table and database designers

uncheck prevent saving changes that require table re-creation

SQL Server Transact-SQL

SQL Server Dumper

SQL Server Dumper enables you to dump selected SQL Server database tables into SQL INSERT statements, that are saved as local .sql files and contain all the data required to create a duplicate table, or to be used for backup purposes. You can choose to create an individual .sql file for each table, or combine all selected tables into a single file.

This program implements the following special features:

  • Foreign Keys> order tables in text file in order to insert data without colisions/errors
  • Primary Key IDENTITY> guarantees the value of the IDENTITY field
  • Reference to itself> eliminates the constraint and at the end create it again

http://sqldumper.ruizata.com/

ASP.Net Microsoft

TreeView.SelectedNodeChanged Event, doesn’t fire

Occurs when a node is selected in the TreeView control.

If we assign any URLs to the NavigateUrl propery of the TreeNode, it will render as a <a> tag, it will not do postback, so it will not file the event;

If we do not assign any URLs to the NavigateUrl propery of the TreeNode, it will render as a short JavaScript which used to postback.

So I think maybe you have assign URLs to the NavigateUrl propery of the TreeNode.

 

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.selectednodechanged.aspx

http://forums.asp.net/t/1361178.aspx/1

Microsoft SQL Server Transact-SQL

SQL SERVER – Insert Data From One Table to Another Table

INSERT INTO SELECT – SELECT INTO TABLE

Following three questions are many time asked on this blog.

How to insert data from one table to another table efficiently?
How to insert data from one table using where condition to anther table?
How can I stop using cursor to move data from one table to another table?

There are two different ways to implement inserting data from one table to another table. I strongly suggest to use either of the method over cursor. Performance of following two methods is far superior over cursor. I prefer to use Method 1 always as I works in all the case.

read more »

.NET ASP.Net Google

ASP.NET GoogleMaps User Control

GoogleMaps.Subgurim.NET is the most advanced Google Maps control for ASP.NET 2.0.
Making available the full power of the official GoogleMaps API, yet without the need of a single line of javascript code: you code only in ASP.NET!
To get going, you just drag the control from the toolbox onto the Visual Studio design surface, and with a few lines of code you will be able program powerful Google Maps applications!

http://en.googlemaps.subgurim.net

Hyper-V Microsoft Networking Virtualization

Microsoft Lync

Windows 8 is going to be including a client hypervisor running a version of Hyper-V

  • Hyper-V on Windows 8 client will require 64 bit and SLAT
  • It will support small to large VMs.  The VM size noted included 32 processors and 512 GB of RAM!
  • Console views for virtual machines can support up to 1600 x 1200 (nice, as I have that resolution on my PC)
  • Support for VHD and VHDX
  • “Live Storage Move” capabilities
  • Virtual Machines with using wireless NICs on hosts
  • Physical machine “sleep” still works (major change from previous releases)

source links:

  • http://media.ch9.ms/ch9/cddc/8b132177-428a-4b5d-8267-9f560134cddc/HyperV09062011_low_ch9.mp4
  • http://blogs.msdn.com/b/b8/archive/2011/09/07/bringing-hyper-v-to-windows-8.aspx
  • http://lync.microsoft.com/pt-br/Paginas/default.aspx
  • http://www.microsoft.com/download/en/details.aspx?id=21129
  • http://office.microsoft.com/en-us/communicator-help/video-what-is-lync-2010-VA102056728.aspx
.NET AJAX ASP.Net 2.0 Microsoft

.NET Framework 4 Chart Controls

You can now download Visual Studio 2010 projects that contain all the samples targeting .NET Framework 4.

The samples environment for Microsoft Chart Controls for .NET Framework contains over 200 samples for both ASP.NET and Windows Forms. The samples cover every major feature in Chart Controls for .NET Framework. They enable you to see the Chart controls in action as well as use the code as templates for your own web and windows applications.

ChartSamples_thumb_1.jpg

The samples environments each contains a Getting Started section to help you start using the Chart controls quickly. The samples demonstrates how to use the following features in Microsoft Chart Controls for .NET Framework:

  • All supported chart types.
  • Data series, chart areas, axes, legends, labels, titles, and more.
  • Data Binding
  • Data manipulation, such as copying, splitting, merging, alignment, grouping, sorting, searching, filtering, and more.
  • Statistical formulas and financial formulas.
  • Advanced chart appearance, such as 3D, anti-aliasing, lighting, perspective, and more.
  • Chart rendering.
  • Events and Customizations.
  • Interactivity and AJAX.

http://archive.msdn.microsoft.com/mschart