Re: Any Option to Save Changes to Database?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Jonathan,

While debugging your vb application, use Explorer to look in the app's
bin/debug folder for the database file. If it is in the bin/debug folder then
it is in fact being copied to the output folder for debugging purposes.

If you don't see the database file being copied, then while your app is
running, make some change to the database. Then while your app is still
running, use SQL Server's Management Studio to see if you can see the changes
to the database made by your app.

These techniques might give you a better idea as to what is going on.

Kerry Moorman


"Jonathan Wood" wrote:

Again, there is no "db file" in my solution explorer. I am not using an
attached file. The database was created as a SQL Server database. I've
described this several times now and am not sure if I'm using the exact,
correct terminology. But I can tell you there is no database file listed
under solution explorer.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Patrice" <http://www.chez.com/scribe/> wrote in message
news:F6CDE4EB-0DF3-4365-920E-569EA7B90390@xxxxxxxxxxxxxxxx
Selec tthe db file in your solution explorer and display the properties
for this file. This is a property applied to your file as part of the
soltuion. It has nothing to do with SQL Server Express itself...

IMO this is quite clever (you always restart with known data plus if you
create a seup it avoid to distribute your test data all over the place)
that said it's quite a bad choice to have choosed this option by
default...

My personal preference is even not to add my data files as part of the
project but just to define the connection string...

--
Patrice

"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> a écrit dans le message de groupe
de discussion : uEj6zKN8IHA.3724@xxxxxxxxxxxxxxxxxxxxxxx
If I select the database under Data Connections in the Server Explorer,
there's only a couple of properties and none of them are "Copy to
Output." And they're all greyed out anyway. As I think I mentioned, I'm
not attaching a database file. It's a SQL Server Express database. So
where would I got to find this option?

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Kerry Moorman" <KerryMoorman@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:540A8243-F316-42D4-ABAF-5AD8E2E94120@xxxxxxxxxxxxxxxx
Jonathan,

I'm pretty sure that SQL Server Express databases have the "Copy to
Ouput"
option.

Kerry Moorman


"Jonathan Wood" wrote:

Okay, I finally got databases working with my ASP.NET projects. Now,
I'm
back to WinForms so here we go again.

I understand that when creating a database file in my project, the
default
settings is to silently wipe out any existing data each time I run my
project. (Brilliant!) So I'm creating a test project in VS 2005 that
uses a
SQL Server Express database. I then created a Windows form and bound my
edit
controls to a table in the database. I'm able to add any number of
records
and browse through them. But, again, if I terminate and restart the
project,
all the data is gone.

SQL Server databases don't have a "Copy to Output" option so I'm not
sure
where to go on this. I guess Microsoft just assumed anyone working with
WinForms wouldn't want to keep any data they created.

Does anyone know the trick to making my database changes permanent?

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com






.



Relevant Pages

  • Re: Any Option to Save Changes to Database?
    ... User Instance is not part of my connection stirng. ... "Jonathan Wood" wrote in message ... I'm not attaching a database file. ... It's a SQL Server Express database. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Which Method to Create a Database Do I Use?
    ... >> SQL Server Configuration Manager ... This mode assumes that the Windows User or IIS has rights to access the SQL Server itself and the database mentioned as the initial catalog in the Connection String. ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... "Jonathan Wood" wrote in message ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Which Method to Create a Database Do I Use?
    ... "William Vaughn" wrote in message ... This mode assumes that the Windows User or IIS has rights to access the SQL Server itself and the database mentioned as the initial catalog in the Connection String. ... "Jonathan Wood" wrote in message ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Local datastore for visual basic .net aplication on a pda
    ... >>> most of the database access controls and etc available on the full .net ... >>> framework arenīt available for the .net compact framework, so, so much ... >>> database file as an local datastore without the SQL server running? ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Any Option to Save Changes to Database?
    ... Make sure you are not using SQL Server Express' USER INSTANCE. ... "Jonathan Wood" wrote in message ... I'm not attaching a database file. ... WinForms wouldn't want to keep any data they created. ...
    (microsoft.public.dotnet.framework.adonet)