本文整理汇总了C#中DBManager.GetDataTableFromSQL方法的典型用法代码示例。如果您正苦于以下问题:C# DBManager.GetDataTableFromSQL方法的具体用法?C# DBManager.GetDataTableFromSQL怎么用?C# DBManager.GetDataTableFromSQL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager
的用法示例。
在下文中一共展示了DBManager.GetDataTableFromSQL方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllDataListCategory
static public DataTable GetAllDataListCategory()
{
String SQL = "select Category, Category from Sch.DesignformDatalist group by category";
DBManager db = new DBManager();
return db.GetDataTableFromSQL(SQL);
}
示例2: GetMaxTabID
static public Int32 GetMaxTabID()
{
DBManager oDB = new DBManager();
DataTable oDS = oDB.GetDataTableFromSQL("Select Max(FormTabID)as MaxTabID From sch.DesignFormTab");
if (oDS.Rows.Count > 0)
{
if (oDS.Rows[0]["MaxTabID"] != null && oDS.Rows[0]["MaxTabID"].ToString() != string.Empty )
{
Int32 rCount = Convert.ToInt32(oDS.Rows[0]["MaxTabID"].ToString());
rCount = rCount + 1;
return rCount;
}
}
return 0;
}
示例3: GetAllFieldsByTableName
public static DataTable GetAllFieldsByTableName(String TableName)
{
String SQL = @" GetDBSchema @Type ='GetAllFiledsByTableName' ,
@TableName='" + TableName + "'";
DBManager db = new DBManager();
DataTable oDS = db.GetDataTableFromSQL(SQL);
return oDS;
}
示例4: GetDataTableStructure
public static DataTable GetDataTableStructure(string TableName, string IDName, Int64 IDValue)
{
String SQL = @" Select * from " + TableName + " where " + IDName + " = " + IDValue;
DBManager db = new DBManager();
DataTable oDS = db.GetDataTableFromSQL(SQL);
return oDS;
}
示例5: SetPanelControl
//.........这里部分代码省略.........
}
//oDDL.SkinID = "sDropDownList";
if (oItem.IsVisible == true)
{
if (oItem.IsEnabled == false)
{
oDDL.Enabled = false;
}
bool IsTop = int.TryParse(oItem.ControlTop.ToString(), out num);
if (IsTop == true)
{
cssStyle = ccsRelative + ccsTop + num.ToString() + ccsPX;
// oDDL.Attributes.Add(AppConstManager.cStyle, AppConstManager.ccsRelative);
// oDDL.Attributes.Add(AppConstManager.cStyle, num.ToString() + AppConstManager.ccsPX);
}
bool IsLeft = int.TryParse(oItem.ControlLeft.ToString(), out num);
if (IsLeft == true)
{
cssStyle = cssStyle + ccsLeft + num.ToString() + ccsPX;
//oDDL.Attributes.Add(AppConstManager.cStyle, AppConstManager.ccsLeft + num.ToString() + AppConstManager.ccsPX);
}
// oDDL.Attributes.Add(AppConstManager.cStyle, cssStyle);
//Get data source
if (oItem.QueryStatement != null)
{
if (oItem.QueryStatement != string.Empty)
{
DBManager oDB = new DBManager();
DataTable oDS = oDB.GetDataTableFromSQL(oItem.QueryStatement);
string DisplayValue = oDS.Columns[0].ColumnName;
string IDValue = oDS.Columns[1].ColumnName;
SetListToDropDownList(oDS, oDDL, DisplayValue, IDValue);
// oDDLManager.SetDatasetToDropDownList(oDS, oDDL, DisplayValue, IDValue, true);
}
}
else
{
if (oItem.DataListType != null && oItem.DataListType != string.Empty)
{
List<DesignFormDataList> oDDLList = DesignFormDataList.GetDataListByType(oItem.DataListType);
oDDL.DataSource = oDDLList;
oDDL.DataTextField = "DisplayField";
oDDL.DataValueField = "ValueField";
oDDL.DataBind();
}
}
//set label
if (oItem.IsReadOnly == true)
{
oDDL.Enabled = false;
}
SetControlLabel(oPanel, oItem, eFormID);
LiteralControl oLiteral = new LiteralControl();
oLiteral.Text = "<Div id=\"DIV" + oDDL.ID + "\" Style='" + cssStyle + "'>";