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)
&
Ïà¹ØÎĵµ£º
ËäÈ»ÕâÊÇÎÒÕÒµ½×îÏêϸµÄÅäÖÃÃèÊö£¬µ«Êdz¢ÊÔ»¹ÊÇûÓгɹ¦¡£
1.ÏÂÔØOracle Client Package
.
´Ó
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html
ÏÂÔØ
Instant
Client Package – Basic
°ü
(
±ê×¢
:All files
required to run OCI, OCCI, and JDBC-OC ......
½ñÌìÔÚÍøÉÏÕÒÁËÐí¾Ã¹ØÓÚsqlserverÖд洢imageÀàÐͺͶÁÈ¡imageµÄ·½·¨£¬¿ÉÊǶ¼ÊÇÄÇôһµã£¬¹ÊÔÚ´ËÂÞÁÐһϣ¬Ï£Íû¿ÉÒÔ°ïÖú´ó¼Ò¡£
Ê×ÏÈÊǹØÓÚdataGridViewµÄ°ó¶¨¡£´úÂë¼ûÏÂ
private void button_show_Click(object sender, EventArgs e)
{
string sqlText = "server=localhost;initial catalog=Test; ......
SqlÁ¬½Ó²éѯºÍÁªºÏ²éѯ
Á¬½Ó²éѯ
ͨ¹ýÁ¬½ÓÔËËã·û¿ÉÒÔʵÏÖ¶à¸ö±í²éѯ¡£Á¬½ÓÊǹØϵÊý¾Ý¿âÄ£Ð͵ÄÖ÷ÒªÌص㣬ҲÊÇËüÇø±ðÓÚÆäËüÀàÐÍÊý¾Ý¿â¹ÜÀíϵͳµÄÒ»¸ö±êÖ¾¡£
ÔÚ¹ØϵÊý¾Ý¿â¹ÜÀíϵͳÖУ¬±í½¨Á¢Ê±¸÷Êý¾ÝÖ®¼äµÄ¹Øϵ²»±ØÈ·¶¨£¬³£°ÑÒ»¸öʵÌåµÄËùÓÐÐÅÏ¢´æ·ÅÔÚÒ»¸ö±íÖС£µ±¼ìË÷Êý¾Ýʱ£¬Í¨¹ýÁ¬½Ó²Ù×÷² ......
¹Ì¶¨·þÎñÆ÷½ÇÉ«
sysadmin ¿ÉÒÔÔÚ SQL Server ÖÐÖ´ÐÐÈκλ¡£
serveradmin ¿ÉÒÔÉèÖ÷þÎñÆ÷·¶Î§µÄÅäÖÃÑ¡Ï¹Ø±Õ·þÎñÆ÷¡£
setupadmin ¿ÉÒÔ¹ÜÀíÁ´½Ó·þÎñÆ÷ºÍÆô¶¯¹ý³Ì¡£
securityadmin ¿ÉÒÔ¹ÜÀíµÇ¼ºÍ CREATE DATABASE ȨÏÞ£¬»¹¿ÉÒÔ¶ÁÈ¡´íÎóÈÕÖ¾ºÍ¸ü¸ÄÃÜÂë¡£
processadmin ¿ÉÒÔ¹ÜÀíÔÚ SQL Server ÖÐÔËÐеĽø³Ì¡£
......
ÖÁ½ñδÓгɾͣ¬Éõ¸ÐáÝáå¡£
²¢²»ÊǺÜͻȻµÄÏëѧSQL£¬¶øÊÇÔÚ֮ǰ˵µÄÄÇÑù£¬ÔÚÎÒÈÆÁËÒ»´óȦ֮ºó£¬²ÅÖªµÀ×Ô¼ºÒ²ÊÇÒ»ÎÞËùÖª£¬Í÷ѧÁËÕâô¶àÄê¡£
ÎÒÒ»Ö±ÏëÍÑÀëѧУµÄ½ÌÓýģʽÀ´×Ôѧ£¬È»¶øÎÒ²¢²»³ÐÈÏѧУµÄ½ÌÓý·½Ê½ÊÇÒ»ÎÞËùÓõģ¬ÖÁÉÙѧµ½µÄ¶«Î÷ÊÇʵÔڵġ£´ÓѧУµÄ½Ç¶ÈÀ´¿¼ÂÇ£¬ ......