本文整理汇总了C#中DevInfo.Lib.DI_LibDAL.Connection.DIConnection.AddColumn方法的典型用法代码示例。如果您正苦于以下问题:C# DIConnection.AddColumn方法的具体用法?C# DIConnection.AddColumn怎么用?C# DIConnection.AddColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevInfo.Lib.DI_LibDAL.Connection.DIConnection
的用法示例。
在下文中一共展示了DIConnection.AddColumn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckNCreateIsMapServerColumnInMDBDatabase
/// <summary>
/// Check and create the IsMapServer column in Databases.mdb database
/// </summary>
private void CheckNCreateIsMapServerColumnInMDBDatabase()
{
DIConnection dIConnection = null;
try
{
dIConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, Server.MapPath("../../stock/Database.mdb"),
string.Empty, string.Empty);
try
{
DataTable table = dIConnection.GetConnection().GetSchema("Columns");
var v = from r in table.AsEnumerable() where (r["TABLE_NAME"].ToString() == "MappingInformation" && r["COLUMN_NAME"].ToString() == "mapserver_used") select r;
if (v.Count() == 0)
{
dIConnection.AddColumn("mappinginformation", "mapserver_used", "Text", "False");
}
}
catch
{
}
}
catch (Exception ex)
{
Global.WriteErrorsInLogFolder("error in Registering new database");
Global.CreateExceptionString(ex, null);
}
finally
{
if (dIConnection != null)
{
dIConnection.Dispose();
dIConnection = null;
}
}
}