Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

IBatisNet SQL ServerµÄfloatÀàÐÍת»»Îªc# float³ö´í

½ñÌìдһ¸öÉÌÆ·µÄÐ޸ŦÄÜʱÓöµ½µÄÎÊÌâ
ÉÌÆ·ÖÐÖØÁ¿ weight µÄÊý¾Ý¿â(SQL Server2005)ÀàÐͶ¨ÒåΪ float
ÔÚmappings ÖÐת»»Îªc#ÀàÐ͵ÄÒ»¾äΪ
<result property="Goods_Weight" column="Goods_Weight" type="float" dbType="float"/>
°´Àí˵Õâ¸ö float ÊÇÒ»ÑùµÄ£¬×ª»»ÍêÈ«²»»á³öÏÖÎÊÌ⣬
ʵ¼Ê³ÌÐòÔËÐÐʱ£¬ÏµÍ³±¨´í
²¶×½µ½ System.InvalidCastException
  Message="Ö¸¶¨µÄת»»ÎÞЧ¡£"
  Source="System.Data"
  StackTrace:
       ÔÚ System.Data.SqlClient.SqlBuffer.get_Single()
       ÔÚ System.Data.SqlClient.SqlDataReader.GetFloat(Int32 i)
       ÔÚ IBatisNet.DataMapper.Commands.DataReaderDecorator.System.Data.IDataRecord.GetFloat(Int32 i)
       ÔÚ IBatisNet.DataMapper.TypeHandlers.SingleTypeHandler.GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
       ÔÚ IBatisNet.DataMapper.Configuration.ResultMapping.ResultProperty.GetDataBaseValue(IDataReader dataReader)
       ÔÚ IBatisNet.DataMapper.MappedStatements.ResultStrategy.AutoMapStrategy.Process(RequestScope request, IDataReader& reader, Object resultObject)
       ÔÚ IBatisNet.DataMapper.MappedStatements.ResultStrategy.ResultClassStrategy.Process(RequestScope request, IDataReader& reader, Object resultObject)
       ÔÚ IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForObject(RequestScope request, ISqlMapSession session, Object parameterObject, Object resultObject)
       ÔÚ IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject(ISqlMapSession session, Object parameterObject, Object resultObject)
       ÔÚ IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject(ISqlMapSession session, Object parameterObject)
     &


Ïà¹ØÎĵµ£º

̽ÌÖPHP SQL×¢ÈëµÄ½â¾ö˼·

˼·:SQLÀᄀ¿ÉÄܵIJÉÓÃÁ½¸öÒýºÅ±ÕºÏ±äÁ¿;¶Ô±äÁ¿ÖеÄÒýºÅתÒå;¶Ô²»ÄܲÉÓÃ2¸öÒýºÅ±ÕºÏµÄ±äÁ¿,ÏÈÔ¤ÏÈÅжϱäÁ¿ÀàÐÍ;  
   
  ·½°¸:  
  1   ËùÓзÇÊýÖµÔËËã(Èç×Ö·û,¼òµ¥ÊýÖµÐ͵ȵÈ)µÄSQL±äÁ¿¶¼¼ÓÒýºÅ;  
  2   ËùÓзÇÊýÖµÔËËãµÄSQL±äÁ¿µÄÖµ¶¼²ÉÓÃmagic_quotes_gpc» ......

ÔõÑùÔÚvisual studio.NET ÈÃC,C++,C#´úÂë×Ô¶¯ÅÅÆë

ÎÊÌâÃèÊö£º
C#³ÌÐò,ÀïÃæcopyÁËÐí¶àÔ­À´µÄ´úÂë,ËùÒԲβÆëµÄ,ºÜÄѶÁ,ÈçºÎ²ÅÄÜÈôúÂë×Ô¶¯ÅÅÆë,¾ÍÏóVS   6.0ÖпÉÒÔʹÓÿì½Ý¼ü,·Ç³£·½±ã.
½â´ð£º
ctrl+a,ÏÈÈ«Ñ¡   
ctrl+k,ctrl+f,×Ô¶¯ÅÅÁÐ
»òÕß
ctrl+a,ÏÈÈ«Ñ¡
alt+F8 ×Ô¶¯ÅÅÁÐ ......

ÔÚlinuxÉÏÅäÖÃunixODBCºÍFreeTDS·ÃÎÊMS SQL Server.

Ò», °²×° unixODBC
ÏÂÔØ°²×°°ü. ÔÚ RedHat °²×°¹âÅÌÉϾÍÓÐ
unixODBC-2.2.11-1.RHEL4.1.i386.rpm
unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm
unixODBC-kde-2.2.11-1.RHEL4.1.i386.rpm
°²×°
rpm -Uvh unixODBC-2.2.11-1.RHEL4.1.i386.rpm
rpm -Uvh unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm
Èç¹û°²×°ÖÐÌáʾÓжÔÆäËü° ......

sql server2005 rownumͨÓô洢¹ý³Ì·ÖÒ³

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER   PROCEDURE [dbo].[sp_GetRecordfromPage]
@TableName varchar(350),        --±íÃû
@Fields varchar(5000) = '*',    --×Ö¶ÎÃû(È«²¿×Ö¶ÎΪ*)
@OrderField varchar(5000),   &nbs ......

SQL Server 2005ÊÓͼ½âÎöÔ­Àí

1£ºµ± SQL Óï¾äÒýÓ÷ÇË÷ÒýÊÓͼʱ£¬·ÖÎöÆ÷ºÍ²éѯÓÅ»¯Æ÷½«·ÖÎö SQL Óï¾äµÄÔ´ºÍÊÓͼµÄÔ´£¬È»ºó½«ËüÃǽâÎöΪµ¥¸öÖ´Ðмƻ®¡£Ã»Óе¥¶ÀÓÃÓÚ SQL Óï¾ä»òÊÓͼµÄ¼Æ»®¡£
2£ºË÷ÒýÊÓͼµÄÐÐÒÔ±íµÄ¸ñʽ´æ´¢ÔÚÊý¾Ý¿âÖС£Èç¹û²éѯÓÅ»¯Æ÷¾ö¶¨Ê¹Óòéѯ¼Æ»®µÄË÷ÒýÊÓͼ£¬ÔòË÷ÒýÊÓͼ½«°´ÕÕ»ù±íµÄ´¦Àí·½Ê½½øÐд¦Àí ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ