How to update data in entity at any time

Source: Internet
Author: User

1. Real-time record:

VaR anum = sysconfigentitybll. getqueryable (). firstordefault (item => item. Key. Trim () = "22 ");

 

In the data handler class call:

 

Public iqueryable <sysconfig> getqueryable ()
{
Mwtsentities. sysconfigs. mergeoption = mergeoption. overwritechanges;
Return mwtsentities. sysconfigs. asqueryable ();
}

Conclusion: real-time data can be obtained and updated in a timely manner.

 

2. Reload a data table

Use [OMSS]
Go

/***** Object: Table [DBO]. [dispatchinfo] script Date: 10/28/2011 10:51:43 ******/
Set ansi_nulls on
Go

Set quoted_identifier on
Go
Drop table [dispatchinfo]
Create Table [DBO]. [dispatchinfo] (
[ID] [int] identity (1, 1) not null,
[Dispatchsponsors] [nchar] (10) null,
[Dispatchstart] [nvarchar] (50) null,
[Dispatchend] [nvarchar] (50) null,
[Dispatchtime] [datetime] Null,
[Dispatchcontent] [nvarchar] (max) null,
[Dispatchmark] [nchar] (10) null,
[Dispatchremark] [nchar] (10) null,
[Devicetype] [int] Null,
Constraint [pk_dispathchinfo] primary key clustered
(
[ID] ASC
) With (pad_index = OFF, statistics_norecompute = OFF, ignore_dup_key = OFF, allow_row_locks = on, allow_page_locks = on) on [primary]
) On [primary]

Go

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.