本文整理汇总了C#中DBManager.ExecuteScalar方法的典型用法代码示例。如果您正苦于以下问题:C# DBManager.ExecuteScalar方法的具体用法?C# DBManager.ExecuteScalar怎么用?C# DBManager.ExecuteScalar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager
的用法示例。
在下文中一共展示了DBManager.ExecuteScalar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertUser
public string InsertUser(string Username,string Mailid)
{
string Result = "a";
DBManager DbObj=new DBManager();
DbParameter[] dbparms = new DbParameter[2];
dbparms[0] = DbObj.CreateParameter("@Username", Username);
dbparms[1] = DbObj.CreateParameter("@UserMail", Mailid);
Result = DbObj.ExecuteScalar("InsertUser", dbparms, CommandType.StoredProcedure).ToString();
return Result;
}
示例2: Getuserbymail
public int Getuserbymail(string Mailid)
{
int Result;
DBManager DbObj = new DBManager();
DbParameter[] dbparms = new DbParameter[1];
dbparms[0] = DbObj.CreateParameter("@Mail", Mailid);
Result = Convert.ToInt32(DbObj.ExecuteScalar("GetUserbyMail", dbparms, CommandType.StoredProcedure));
return Result;
}
示例3: InsertTask
public string InsertTask(string Task, string Task_Descriprtion, string Priority, string Time, int UserId,string Status)
{
string Result = "";
DBManager DbObj = new DBManager();
DbParameter[] dbparms = new DbParameter[6];
dbparms[0] = DbObj.CreateParameter("@Task", Task);
dbparms[1] = DbObj.CreateParameter("@Task_Desc", Task_Descriprtion);
dbparms[2] = DbObj.CreateParameter("@Priority", Priority);
dbparms[3] = DbObj.CreateParameter("@Time", Time);
dbparms[4] = DbObj.CreateParameter("@userid", UserId);
dbparms[5] = DbObj.CreateParameter("@Status", Status);
Result = DbObj.ExecuteScalar("InsertTask", dbparms, CommandType.StoredProcedure).ToString();
return Result;
}