C#操作SQL Float類型,數據會多很多小數,原來是C#的float和sql的float類型不一致
/// <summary>
/// 數據庫中與C#中的數據類型對照
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
private string ChangeToCSharpType(string type)
{
string reval = string.Empty;
switch (type.ToLower())
{
case "int":
reval = "Int32";
break;
case "text":
reval = "String";
break;
case "bigint":
reval = "Int64";
break;
case "binary":
reval = "System.Byte[]";
break;
case "bit":
reval = "Boolean";
break;
case "char":
reval = "String";
break;