我正在使用Entity framework 4.1,我使用以下方法在表中插入数据它不是在表中插入数据。
方法:
private void InsertSMSStatus(Request request)
{
UtilitiesEntities context = new UtilitiesEntities();
SMSAlertLog alertLog = new SMSAlertLog();
alertLog.Recipients = request.To;
alertLog.Sender = From;
alertLog.Status = Convert.ToInt32(request.ResponseString);
context.SaveChanges();
context.Dispose();
}
连接字符串:
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup><connectionStrings><add name="UtilitiesEntities" connectionString="metadata=res://*/DataModel.SmsEntityModel.csdl|res://*/DataModel.SmsEntityModel.ssdl|res://*/DataModel.SmsEntityModel.msl;provider=System.Data.SqlClient;provider connection string="data source=bosql1srv;initial catalog=Utilities;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /></connectionStrings></configuration>
任何想法?