SVN r1096
SVN-Revision: r1096
This commit is contained in:
@@ -1972,4 +1972,28 @@ namespace Lskj.Control.Model
|
|||||||
DataRow[] dataRows = columnsTab.Select().Where(n => (n["name"] + "").Equals(colunmField.Key)).ToArray();
|
DataRow[] dataRows = columnsTab.Select().Where(n => (n["name"] + "").Equals(colunmField.Key)).ToArray();
|
||||||
if (dataRows.Length == 0)
|
if (dataRows.Length == 0)
|
||||||
{
|
{
|
||||||
string a
|
string addColSql = string.Format("alter table P_PrivateDllTab add {0} {1}", colunmField.Key, colunmField.Value);
|
||||||
|
SqlHelper.ExecuteNonQuery(addColSql);//添加列
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string createTabSql = "create table P_PrivateDllTab(id int IDENTITY(1,1) NOT NULL,{0})";
|
||||||
|
string createCol = string.Empty;
|
||||||
|
foreach (KeyValuePair<string, string> colunmField in colDic)
|
||||||
|
{
|
||||||
|
createCol += string.Format("{0} {1},", colunmField.Key, colunmField.Value);
|
||||||
|
}
|
||||||
|
createTabSql = string.Format(createTabSql, createCol.TrimEnd(','));
|
||||||
|
SqlHelper.ExecuteNonQuery(createTabSql);//创建表
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user