473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Writing to SQL Server 2005 Express Edition not saving from C# App

I'm new to C#, so this really easy to answer for anyone that is adept at
this...

I'm having trouble saving data from my text boxes on a user form to my SQL
database. Everything works fine while in debug mode, the data is saved and
reflcted like it shoul be, but once I exit debug mode, all the changes are
lost when I reopen the app in debug mode again?

I saw the answer to this problem in a video but cannot find the video again?
I tried changing some properties of the database files but can't seem to
find the right file to change to mak it work. I believe I need to change a
property to either "Save Always" or "Save if Newer" if that turns on any
lightbulbs for anyone? I think this is only a problem for me while running
the app in debug mode (the video said). I believe if I delivered this app to
someone else as an .exe, it would work fine (thats what the video was saying
when they explained which file I needed to change to "copy always" or "copy
if newer").

Thank You,
Matt

Oct 29 '07 #1
2 1230
"Matt" <co*************@hotmail.comwrote in message
news:uC**************@TK2MSFTNGP03.phx.gbl...
I'm new to C#, so this really easy to answer for anyone that is adept at
this...

I'm having trouble saving data from my text boxes on a user form to my SQL
database. Everything works fine while in debug mode, the data is saved and
reflcted like it shoul be, but once I exit debug mode, all the changes are
lost when I reopen the app in debug mode again?

I saw the answer to this problem in a video but cannot find the video
again? I tried changing some properties of the database files but can't
seem to find the right file to change to mak it work. I believe I need to
change a property to either "Save Always" or "Save if Newer" if that turns
on any lightbulbs for anyone? I think this is only a problem for me while
running the app in debug mode (the video said). I believe if I delivered
this app to someone else as an .exe, it would work fine (thats what the
video was saying when they explained which file I needed to change to
"copy always" or "copy if newer").
If you are using Sql Server Express in "User-Instance" mode with the
Visual Studio default configuration, then every time that you run your
project in Debug mode Visual Studio copies the .mdf that contains the
database in your project directory into the build directory. The program
then uses that copy and it writes correctly. But if you then run it again,
it gets overwritten with the copy in the project folder, so you lose your
changes.
Change the properties of the .mdf file and set it to "Copy if newer" if
you want the database to only be overwritten when you make changes to its
design.

Oct 29 '07 #2
Thank you for the explanation, it sucks being new to a language, a
development environment, a database system, etc! I hope the learning curve
goes a bit faster as time goes on...

Matt

"Matt" <co*************@hotmail.comwrote in message
news:uC**************@TK2MSFTNGP03.phx.gbl...
I'm new to C#, so this really easy to answer for anyone that is adept at
this...

I'm having trouble saving data from my text boxes on a user form to my SQL
database. Everything works fine while in debug mode, the data is saved and
reflcted like it shoul be, but once I exit debug mode, all the changes are
lost when I reopen the app in debug mode again?

I saw the answer to this problem in a video but cannot find the video
again? I tried changing some properties of the database files but can't
seem to find the right file to change to mak it work. I believe I need to
change a property to either "Save Always" or "Save if Newer" if that turns
on any lightbulbs for anyone? I think this is only a problem for me while
running the app in debug mode (the video said). I believe if I delivered
this app to someone else as an .exe, it would work fine (thats what the
video was saying when they explained which file I needed to change to
"copy always" or "copy if newer").

Thank You,
Matt

Oct 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: NetIdiot | last post by:
I have had to install and uninstall VS.NET 2005 a couple of times because of some errors. The SQL Server express refuses to install ... and hence I can't most things I want to work on. I even tried...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
8
by: JJ | last post by:
My potential shared hosting platform uses SQL server 2005. I am developing on the Express version. In order to make sure I am not going to cause myself any problems when I move my ASP .net 2.0...
2
by: farseer | last post by:
Hi, I have SQL Server 2005 installed on my dev system. I am working on an app that i would like to distribute SQL Server with. SQL Server EXpress edition seem to be ideal for this. My questions...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
2
by: kress1963nov22 | last post by:
I recently purchased a good MS book ("Build a Web Site Now") by Jim Buyens. It has the Express Edition of MS-Visual Web Developer 2005 on CD and also MS SQL Server 2005 Express Edition on the CD. A...
3
by: Steve | last post by:
Hi All I downloaded Sql server 2005 express SP2 and attempted to modify the Bootstrapper package files as I did with SP1 When i try to install SQL server as part of my VS 2005 deployment app I...
4
by: Wolfgang Kraus | last post by:
Hi, i want to create a solution which shall consist of a sql server 2005 - data base (express edition if the following features are available by express edition) and a mobile windows application...
2
by: samadams_2006 | last post by:
Hello, I have a problem that I'm hoping someone will be able to help me resolve. 1) I have a C# Web Site in which I connect to the database: "Install Microsoft SQL Server 2005 Express...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.