SubSonic SQL insert

Source: Internet
Author: User

Public bool savebtn (string companyName, string contactName, string phone, string email, DateTime saleDate, string number, string brief, string goods, Decimal quotation, string seller, string handler)
{
///// DAL. Sale. Insert (seller, handler, brief, goods); // transaction processing is still the error of yesterday, and direct insertion is correct!
// QueryCommandCollection coll = new QueryCommandCollection ();
// QueryCommand insert = new QueryCommand ("insert sales (companyName, contactName, phone, email, saleDate, number, quotation, brief, goods, seller, handler) values (@ companyName, @ contactName, @ phone, @ email, @ saleDate, @ number, @ quotation, @ brief, @ goods, @ seller, @ handler )");

// Insert. Parameters. Add ("@ companyName", companyName );
// Insert. Parameters. Add ("@ contactName", contactName );
// Insert. Parameters. Add ("@ phone", phone );
// Insert. Parameters. Add ("@ email", email );

// Insert. Parameters. Add ("@ saleDate", saleDate );
// Insert. Parameters. Add ("@ number", number );
// Insert. Parameters. Add ("@ quotation", quotation );

// Insert. Parameters. Add ("@ brief", brief );
// Insert. Parameters. Add ("@ goods", goods );
// Insert. Parameters. Add ("@ seller", seller );
// Insert. Parameters. Add ("@ handler", handler );
// Coll. Add (insert );
// DataService. ExecuteTransaction (coll );
// Return true;

DAL. Sale insert = new Product. DAL. Sale ();
Insert. CompanyName = companyName;
Insert. ContactName = contactName;
Insert. Phone = phone;
Insert. Email = email;
Insert. SaleDate = saleDate;

Insert. Number = number;
Insert. Quotation = quotation;
Insert. Brief = brief;
Insert. Goods = goods;
Insert. Seller = seller;

Insert. Handler = handler;
Try
{
Insert. Save ();
Return true;
}
Catch
{
Return false;
}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.