Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8270787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:41:17+00:00 2026-06-08T06:41:17+00:00

this is my app.config <configuration> <startup useLegacyV2RuntimeActivationPolicy=true> <supportedRuntime version=v4.0/> </startup> <connectionStrings> <add name=DataBaseEntity connectionString=metadata=res://*/DBModel.csdl|res://*/DBModel.ssdl|res://*/DBModel.msl;provider=System.Data.SQLite;provider

  • 0

this is my app.config

<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
  <connectionStrings>
    <add name="DataBaseEntity"  connectionString="metadata=res://*/DBModel.csdl|res://*/DBModel.ssdl|res://*/DBModel.msl;provider=System.Data.SQLite;provider connection string=&quot;data  source=I:Sompepath\dbfilename&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>

and below is the usage

 using (var context = new DataBaseEntity("name=DataBaseEntity"))
            {
                context.Connection.Open();
                var status = delegatefunction(context);
                if (status)
                {
                    context.AcceptAllChanges();
                    context.SaveChanges(SaveOptions.DetectChangesBeforeSave);
                    context.Connection.Close();
                    return true;
                }
                return false;
            }

the delegate function looks like this

(context =>{var abc = new xyz();                
            context.xyzs.AddObject(abc);});

the database is not having the data which is just added in the delegate

and there is no exception in the application

the connection object in the context looks like this

the database and datasource are empty

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:41:18+00:00Added an answer on June 8, 2026 at 6:41 am

    Remove context.AcceptAllChanges(); That call is telling EF that there are no pending changes so the SaveChanges has nothing to save to database because it believes that all changes were already saved.

    AcceptAllChanges in normally called inside the SaveChanges once all modifications are correctly saved to the database. This method is public to support some complex scenarios where you want to save modifications on multiple context within single transaction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my common app.config <?xml version=1.0 encoding=utf-8 ?> <configuration> <connectionStrings> <add name=BO connectionString=Data
This is my App.Config <?xml version=1.0 encoding=utf-8 ?> <configuration> <appSettings> <add key=lang value=English/> </appSettings>
what I have in app.config is this <?xml version=1.0?> <configuration> <configSections> <sectionGroup name=applicationSettings type=System.Configuration.ApplicationSettingsGroup,
I have this App.config in my wcf service library: <?xml version=1.0?> <configuration> <appSettings> <add
I've got an app.config file, which contains the following <?xml version=1.0 encoding=utf-8 ?> <configuration>
I'm using this code to read the connection string from my app.config file but
My db-data-config.xml like this: <dataSource name=192.168.5.206 driver=com.mysql.jdbc.Driver url=jdbc:mysql://192.168.5.206:3306/editor_app user=root password=tvmining /> <dataSource name=localhost driver=com.mysql.jdbc.Driver
Every time my program runs vs adds the default configuration to my app.config file.
<?xml version=1.0 encoding=utf-8 ?> <configuration> <appSettings> <add key=HTTPBaseAddress value=http://localhost:8000/Derivatives//> <add key=TCPBaseAddress value=net.tcp://localhost:8010/Derivatives//> </appSettings> <system.diagnostics>
first of all, I have a .NET 4.0 application with this configuration: <?xml version=1.0?>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.