How to select last 5 or 10 or … rows in a SQL Server data table ? Solution 1: This is the normal solution SELECT TOP N * FROM MyTable ORDER BY Id DESC Solution 2: Solution 1 is the normal way but when the data table is huge but the Id is not indexed, [Read More ...]
There are lots of ways to update a table data, here we have one example as the following: UPDATE HOSTDB SET InScan = NOWHOSTDB.InScan, Alarm1 = NOWHOSTDB.Alarm1, Alarm2 = NOWHOSTDB.Alarm2, Alarm3 = NOWHOSTDB.Alarm3, Alarm4 = NOWHOSTDB.Alarm4 FROM HOSTDB, NOWHOSTDB WHERE HOSTDB.idx = NOWHOSTDB.HOSTDBidx AND HOSTDB.idx = 1640
There was a coder wrote the following code about a SQL Server saving operation: public static bool SaveToDatabase(string strTab, string strSql, SqlConnection Sqlcn, DataSet ds) { SqlCommand comm = new SqlCommand(); comm.CommandText = strSql; comm.Connection = Sqlcn; comm.CommandType = CommandType.Text; SqlDataAdapter sda = new SqlDataAdapter(comm); SqlCommandBuilder scb = new [Read More ...]
When you create a new Windows Form application in Visual Studio 2010, and if you want to do something related config file, normally you will use ConfigurationManager namespace, for example: // Get the AppSettings section. NameValueCollection appSettings = ConfigurationManager.AppSettings; However, when you input “ConfigurationManager” in code, you will find the Visual Studio 2010 display [Read More ...]
Most of .net developers develop Windows applications using SQL Server database, but how about some cases that use MySQL? Microsoft has announced that they no more provider API or connector or related library to connect the 3rd party database such as Oracle, MySQL, the reason is that most of 3rd party companies have already provided [Read More ...]
We can use Bing Map Services directly to implement our Bing Map project. Firstly you should have a Bing Map develop account which is free to register. The starter page is here, you can learn lots of methods which Microsoft provided. For example: If you want to put a static Bing map on your site, [Read More ...]
Some of Bing map and Google map services are not free, For example, They will not provide a free Geo database to developer. Fortunately there are some open source geo information websites. Geonames.org is the one great open source and free geo services provider. About Geonames.org: The GeoNames geographical database is available for download free [Read More ...]
We have a small MVC project, once a time we got the following error message in a popup window: …. Unable to find the requested .Net Framework Data Provider. It may not be installed. The reasons are very depends, there are lots of different reasons on the internet. Our case looks some special: The reason [Read More ...]
Microsoft SQL Server Compact 4.0 is a free, embedded database that software developers can use for building ASP.NET websites and Windows desktop applications. SQL Server Compact 4.0 has a small footprint and supports private deployment of its binaries within the application folder, easy application development in Visual Studio and WebMatrix, and seamless migration of schema [Read More ...]
Silverlight Pixel shaders can manipulate pixels for different effects. There are different shaders: blur and drop shadow. The following is a blur sample: <UserControl x:Class="SilverlightApplication2.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <StackPanel Orientation="Horizontal" > <Image Source="/SilverlightApplication2;component/Images/Koala.jpg" Width="200" Margin="3" > <Image.Effect> [Read More ...]