Giter VIP home page Giter VIP logo

dataaccess's People

Contributors

fs7744 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dataaccess's Issues

reader ExecuteDataReaderAsync 方法 读取为空数据抛异常

目前采取两种方式解决为空数据 Reader问题,使用有点复杂,
方法一>代码里面可以用 IsDBNull(int ordinal)方法先进行判断
if (!reader.IsDBNull(reader.GetOrdinal("MiddleName"))) Console.Write(" {0}", reader.GetString(reader.GetOrdinal("MiddleName")));
方法二>数据库sql查询 进行 isnull判断处理

希望能进行封装

查出来的字符串类型 映射到对应字段希望能进行 RTRIM()处理

希望提供一个新的方法,或者传入一个可选项参数
使得数据查询的时候 查出来的字符串类型 映射到对应字段希望能进行 RTRIM()处理,
原因:
1.绝大多数字符串字段都要进行RTRIM()方法处理 ,
2.加上RTRIM 可读性变差,尤其是嵌套处理的情况
如下代码:

           a.EventMemo,
           RTRIM(a.UserID) As UserID,
           RTRIM(ISNULL(c.Name, a.UserID)) AS [InUser],
           RTRIM(ISNULL(po.sw_shipvia,0)) AS ShipViaCode,
           RTRIM(ISNULL(po.TransportationTypeCode,0)) AS TransportationTypeCode,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.