- tinyint --> Byte --> 0 ~ 255
- smallint --> Short --> +32767
- int --> Integer --> +214748/3647
2014/1/15補充
MSDN與TechNet有兩篇完整參考文件:
MSDN與TechNet有兩篇完整參考文件:
Imports System.Runtime.CompilerServices Imports System.Web Imports System.Web.Configuration Imports System.Web.Helpers Public Module GoogleMapExtension ''' <summary> ''' ''' </summary> ''' <param name="helper">擴充型別</param> ''' <param name="address">地址</param> ''' <param name="mapWidth">寬度</param> ''' <param name="mapHeight">高度</param> ''' <returns></returns> ''' <remarks></remarks> <Extension()> Public Function GoogleMap(helper As HtmlHelper, address As String, mapWidth As Integer, mapHeight As Integer) As MvcHtmlString Dim mapHtml = New StringBuilder() mapHtml.Append("<div id=""map"" style=""width:" & mapWidth.ToString() & "px; height:" & mapHeight.ToString() & "px""></div>") mapHtml.Append("<script src=""http://maps.google.com/maps?file=api&v=2&key=""" & WebConfigurationManager.AppSettings("GoogleMapApiKey") & "\"" type=""text/javascript""></script>") mapHtml.Append("<script type=""text/javascript"">") mapHtml.Append("var geocoder;") mapHtml.Append("var map;") mapHtml.Append("var address = '" & address & "';") mapHtml.Append("map = new GMap2(document.getElementById(""map""));") mapHtml.Append("map.addControl(new GLargeMapControl());") mapHtml.Append("map.addControl(new GMapTypeControl());") mapHtml.Append("geocoder = new GClientGeocoder();") mapHtml.Append("geocoder.getLocations(address, addToMap);") mapHtml.Append("function addToMap(response) {") mapHtml.Append("place = response.Placemark[0];") mapHtml.Append("point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);") mapHtml.Append("map.setCenter(point, 13);") mapHtml.Append("marker = new GMarker(point);") mapHtml.Append("map.addOverlay(marker);") mapHtml.Append("marker.openInfoWindowHtml(place.address);") mapHtml.Append(" }") mapHtml.Append("</script>") Return MvcHtmlString.Create(mapHtml.ToString()) End Function End Module
<%: Html.GoogleMap(ViewBag.Address, 400, 350)%>
Imports NUnit.Framework ''' <summary> ''' 測試類別 ''' </summary> <testfixture()> Public Class HomeControllerTests ''' <summary> ''' 測試方法 ''' </summary> <test()> Public Sub Puts_Message_In_ViewBag() ' HomeController 物件 Dim controller = New HomeController() ' 取得物件 Index() 的結果 Dim result = controller.Index() ' Assert 測試 Index 結果裡的 ViewBag.Message 不是空的 Assert.IsNotEmpty(result.ViewBag.Message) End Sub End Class
NUnit version 2.5.10.11092 Copyright (C) 2002-2009 Charlie Poole. Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. Copyright (C) 2000-2002 Philip Craig. All Rights Reserved. Runtime Environment - OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1 CLR Version: 2.0.50727.5446 ( Net 2.0 ) ProcessModel: Default DomainUsage: Single Execution Runtime: Default . Tests run: 1, Errors: 0, Failures: 0, Inconclusive: 0, Time: 0.980056 seconds Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
NUnit version 2.5.10.11092 Copyright (C) 2002-2009 Charlie Poole. Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. Copyright (C) 2000-2002 Philip Craig. All Rights Reserved. Runtime Environment - OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1 CLR Version: 2.0.50727.5446 ( Net 2.0 ) ProcessModel: Default DomainUsage: Single Execution Runtime: Default .F Tests run: 1, Errors: 1, Failures: 0, Inconclusive: 0, Time: 1.0290589 seconds Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0 Errors and Failures: 1) Test Error : OdeToFood.Tests.HomeControllerTests.Puts_Message_In_ViewBag System.Reflection.AmbiguousMatchException : 多載解析失敗,因為沒有公用 'IsNotEmpty' 對這些引數而言是最適合的: 'Public Shared Sub IsNotEmpty(collection As System.Collections.ICollection)': 不是最特定。 'Public Shared Sub IsNotEmpty(aString As String)': 不是最特定。 於 Microsoft.VisualBasic.CompilerServices.OverloadResolution.ResolveOverloadedCall(String MethodName, List`1 Candidates, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure) 於 Microsoft.VisualBasic.CompilerServices.OverloadResolution.ResolveOverloadedCall(String MethodName, MemberInfo[] Members, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure) 於 Microsoft.VisualBasic.CompilerServices.NewLateBinding.ResolveCall(Container BaseReference, String MethodName, MemberInfo[] Members, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure) 於 Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure) 於 Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) 於 OdeToFood.Tests.HomeControllerTests.Puts_Message_In_ViewBag() 於 D:\StudyTest\OdeToFood\OdeToFood.Tests\HomeControllerTests.vb: 行 19