App_Code/DB/DBCommon.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Data;
static class DBCommon
{
public static string ConvertString(this ColumnDT dt)
{
if (dt.IsGUID || dt.IsString || dt.IsMarking)
{
return "";
}
if (dt.IsInt16)
{
return "Convert.ToInt16";
}
if (dt.IsInt32)
{
return "Convert.ToInt32";
}
if (dt.IsInt64)
{
return "Convert.ToInt64";
}
if (dt.IsDecimal)
{
return "Convert.ToDecimal";
}
if (dt.IsFloat)
{
return "Convert.ToSingle";
}
return "";
}
public static string GetScript(this string script)
{
if (script == null)
{
return "";
}
script = script.Replace("\r\n", "");
if (script.Length > 40)
{
script = script.Substring(0, 40);
}
return script;
}
/// <summary>
/// 根据数据库中的字段类型,取得C#中相应的数据类型。
/// </summary>
/// <param name="type">数据库中的字段类型</param>
/// <returns>C#中的数据类型</returns>
public static string GetCSDataType(string type)
{
type = type.Trim().ToLower();
switch (type)
{
case "char":
后面还有 60 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。