本文整理汇总了C#中Erc.Apple.Data.StoredProcedure.ExecuteScalar方法的典型用法代码示例。如果您正苦于以下问题:C# StoredProcedure.ExecuteScalar方法的具体用法?C# StoredProcedure.ExecuteScalar怎么用?C# StoredProcedure.ExecuteScalar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Erc.Apple.Data.StoredProcedure
的用法示例。
在下文中一共展示了StoredProcedure.ExecuteScalar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public virtual int Add(NewsItem item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("News_AddItem"))
{
sp.Params.Add("@GroupID", System.Data.SqlDbType.Int).Value = item.GroupID;
sp.Params.Add("@LangCode", System.Data.SqlDbType.NChar).Value = item.LangCode;
sp.Params.Add("@Title", System.Data.SqlDbType.NVarChar,255).Value = item.Title;
sp.Params.Add("@ImageFile", System.Data.SqlDbType.VarBinary).Value = item.ImageFile;
sp.Params.Add("@Notice", System.Data.SqlDbType.NVarChar, 1024).Value = item.Notice;
sp.Params.Add("@Text", System.Data.SqlDbType.NVarChar).Value = item.Text;
sp.Params.Add("@LinkUrl", System.Data.SqlDbType.NVarChar, 255).Value = Tools.FixUrl(item.LinkUrl);
sp.Params.Add("@LinkText", System.Data.SqlDbType.NVarChar, 255).Value = item.LinkText;
sp.Params.Add("@Link2Url", System.Data.SqlDbType.NVarChar, 255).Value = Tools.FixUrl(item.Link2Url);
sp.Params.Add("@Link2Text", System.Data.SqlDbType.NVarChar, 255).Value = item.Link2Text;
sp.Params.Add("@ImagePosition", System.Data.SqlDbType.Int).Value = item.ImagePosition;
sp.Params.Add("@IsActive", System.Data.SqlDbType.Bit).Value = item.IsActive;
sp.Params.Add("@IsMain", System.Data.SqlDbType.Bit).Value = item.IsMain;
sp.Params.Add("@Date", System.Data.SqlDbType.DateTime).Value = item.Date;
sp.Params.Add("@OrderNumber", System.Data.SqlDbType.Int).Value = item.OrderNumber;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例2: Add
public int Add(ServiceSpecialization item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("ServiceSpecialization_AddSpecialization"))
{
sp.Params.Add("@ServiceID", System.Data.SqlDbType.NChar).Value = item.ServiceID;
sp.Params.Add("@SpecializationID", System.Data.SqlDbType.NVarChar).Value = item.SpecializationID;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例3: Add
public int Add(ContentPage item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("ContentPages_AddItem"))
{
sp.Params.Add("@Name", System.Data.SqlDbType.NVarChar, 255).Value = item.Name;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例4: Add
public int Add(SerialNumber item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("SerialNumbers_AddItem"))
{
sp.Params.Add("@SerialNumber", System.Data.SqlDbType.NVarChar, 20).Value = item.Number;
sp.Params.Add("@ServiceID", System.Data.SqlDbType.Int).Value = item.ServiceID;
sp.Params.Add("@AdminID", System.Data.SqlDbType.Int).Value = item.AdminID;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例5: Add
public int Add(LogMessage item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("Log_AddItem"))
{
sp.Params.Add("@MessageType", System.Data.SqlDbType.Int).Value = item.MessageType;
sp.Params.Add("@Source", System.Data.SqlDbType.NVarChar, 255).Value = item.Source;
sp.Params.Add("@Message", System.Data.SqlDbType.NVarChar).Value = item.Message;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例6: Add
public int Add(Admin item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("Admins_AddItem"))
{
sp.Params.Add("@Name", System.Data.SqlDbType.NVarChar, 100).Value = item.Name;
sp.Params.Add("@Email", System.Data.SqlDbType.NVarChar, 100).Value = item.Email;
sp.Params.Add("@Password", System.Data.SqlDbType.NVarChar, 50).Value = item.Password;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例7: Add
public virtual int Add(iPadActionSerial item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("iPadActionSerial_AddItem"))
{
sp.Params.Add("@BuyDate", System.Data.SqlDbType.DateTime).Value = item.BuyDate;
sp.Params.Add("@Email", System.Data.SqlDbType.NVarChar).Value = item.Email;
sp.Params.Add("@Serial", System.Data.SqlDbType.NVarChar).Value = item.Serial;
sp.Params.Add("@Seller", System.Data.SqlDbType.Int).Value = item.Seller;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例8: Add
public int Add(NewsSubscriber item)
{
if (!Tools.CheckEmail(item.Email))
throw new InvalidOperationException("Invalid e-mail address");
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("NewsSubscribers_AddItem"))
{
sp.Params.Add("@Name", System.Data.SqlDbType.NVarChar, 255).Value = item.Name;
sp.Params.Add("@Email", System.Data.SqlDbType.NVarChar, 255).Value = item.Email;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例9: Add
public virtual int Add(TranslatableText item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("TranslatableTexts_AddItem"))
{
sp.Params.Add("@ID", System.Data.SqlDbType.NVarChar,50).Value = item.ID;
sp.Params.Add("@GroupID", System.Data.SqlDbType.Int).Value = item.GroupID;
sp.Params.Add("@LangCode", System.Data.SqlDbType.NChar).Value = item.LangCode;
sp.Params.Add("@Text", System.Data.SqlDbType.NVarChar).Value = item.Text;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例10: AddUpdate
public int AddUpdate(City item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("Cities_AddUpdateItem"))
{
sp.Params.Add("LangCode", System.Data.SqlDbType.NChar).Value = item.LangCode;
sp.Params.Add("RegionID", System.Data.SqlDbType.Int).Value = item.RegionID;
sp.Params.Add("Name", System.Data.SqlDbType.NVarChar).Value = item.Name;
sp.Params.Add("GroupID", System.Data.SqlDbType.Int).Value = item.GroupID;
newID = Convert.ToInt32(sp.ExecuteScalar());
item.ID = newID;
}
return newID;
}
示例11: Add
public virtual int Add(ContactForm item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("ContactForms_AddItem"))
{
sp.Params.Add("@Name", System.Data.SqlDbType.NVarChar, 255).Value = item.Name;
sp.Params.Add("@Subject", System.Data.SqlDbType.NVarChar, 255).Value = item.Subject;
sp.Params.Add("@To", System.Data.SqlDbType.NVarChar).Value = item.To;
sp.Params.Add("@CC", System.Data.SqlDbType.NVarChar).Value = item.CC;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例12: Add
public int Add(SeminarRegistration item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("SeminarsRegistration_AddItem"))
{
sp.Params.Add("@CompanyName", System.Data.SqlDbType.NVarChar, 255).Value = item.CompanyName;
sp.Params.Add("@FIO", System.Data.SqlDbType.NVarChar, 255).Value = item.FIO;
sp.Params.Add("@JobTitle", System.Data.SqlDbType.NVarChar, 255).Value = item.JobTitle;
sp.Params.Add("@JobAction", System.Data.SqlDbType.VarChar, 20).Value = item.JobAction;
sp.Params.Add("@Email", System.Data.SqlDbType.NVarChar, 255).Value = item.Email;
sp.Params.Add("@Site", System.Data.SqlDbType.NVarChar, 255).Value = item.Site;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例13: AddUpdate
public int AddUpdate(Product item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("Products_AddUpdateItem"))
{
sp.Params.Add("LangCode", System.Data.SqlDbType.NChar).Value = item.LangCode;
sp.Params.Add("Name", System.Data.SqlDbType.NVarChar).Value = item.Name;
sp.Params.Add("GroupID", System.Data.SqlDbType.Int).Value = item.GroupID;
sp.Params.Add("OrderNumber", System.Data.SqlDbType.Int).Value = item.OrderNumber;
sp.Params.Add("CategoryID", System.Data.SqlDbType.Int).Value = item.CategoryID;
sp.Params.Add("Url", System.Data.SqlDbType.NVarChar).Value = Tools.FixUrl(item.Url);
newID = Convert.ToInt32(sp.ExecuteScalar());
item.ID = newID;
}
return newID;
}
示例14: Add
public int Add(AdminPage item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("AdminPages_AddItem"))
{
sp.Params.Add("@ParentID", System.Data.SqlDbType.Int).Value = item.ParentID;
sp.Params.Add("@Title", System.Data.SqlDbType.NVarChar, 50).Value = item.Title;
sp.Params.Add("@Url", System.Data.SqlDbType.NVarChar, 250).Value = item.Url;
sp.Params.Add("@Control", System.Data.SqlDbType.NVarChar, 250).Value = item.Control;
sp.Params.Add("@OrderID", System.Data.SqlDbType.Int).Value = item.OrderID;
sp.Params.Add("@Active", System.Data.SqlDbType.Bit).Value = item.Active;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}
示例15: Add
public virtual int Add(DevelopersLink item)
{
int newID = 0;
using (StoredProcedure sp = new StoredProcedure("DevelopersLinks_AddItem"))
{
sp.Params.Add("@GroupID", System.Data.SqlDbType.Int).Value = item.GroupID;
sp.Params.Add("@LangCode", System.Data.SqlDbType.NChar).Value = item.LangCode;
sp.Params.Add("@Text", System.Data.SqlDbType.NVarChar).Value = item.Text;
sp.Params.Add("@LinkUrl", System.Data.SqlDbType.NVarChar, 255).Value = Tools.FixUrl(item.LinkUrl);
sp.Params.Add("@LinkText", System.Data.SqlDbType.NVarChar, 255).Value = item.LinkText;
sp.Params.Add("@OrderNumber", System.Data.SqlDbType.Int).Value = item.OrderNumber;
newID = Convert.ToInt32(sp.ExecuteScalar());
}
return newID;
}