初始化
This commit is contained in:
35
DB_Server/DBLib.cs
Normal file
35
DB_Server/DBLib.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DB_Server
|
||||
{
|
||||
internal class DBLib
|
||||
{
|
||||
#region ConvertParameters转换参数类型
|
||||
|
||||
public static T[] ConvertParameters<T>(DbParameter[] commandParameters)where T : DbParameter ,new ()
|
||||
{
|
||||
if (commandParameters == null)
|
||||
return null;
|
||||
T [] _SqlParameters = new T [commandParameters.Length];
|
||||
|
||||
for (int i = 0; i < commandParameters.Length; i++)
|
||||
{
|
||||
_SqlParameters[i] = new T() {
|
||||
ParameterName = commandParameters[i].ParameterName,
|
||||
Value = commandParameters[i].Value,
|
||||
};
|
||||
}
|
||||
|
||||
return _SqlParameters;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user