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 8902973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:45:02+00:00 2026-06-15T01:45:02+00:00

I created a C# program using SQL Server 2008 Express. There is some data

  • 0

I created a C# program using SQL Server 2008 Express.

There is some data that must exist in the database table initially, for the C# application to run correctly.

I would like to transfer this data into the table the first time the C# application executes.

But I don’t want this SQL data (record data) read from my C# code (I don’t want to load this data from hard-coded C# code).

How does SQL Server store its record data, and how can I transfer the initial data into the database?

  • 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-15T01:45:04+00:00Added an answer on June 15, 2026 at 1:45 am

    I’d try to not rely on a database being existent for your application to work. You’re coupling yourself to the database which probably isn’t a good idea. Do you think maybe you could execute a stored procedure from your application which would fill out the tables you’re relying on? That way your DB creation code wouldn’t exist in your application. This would however still mean your application is dependant on the database to function correctly.

    I would recommend one of two plans, the latter being the cleaner.

    Plan 1

    • Create a SQL script which will create and insert all the required data for the application to work and place this in a stored procedure
    • When your application starts first time it will check a configuration file to see if the program has ran before, if not, execute the stored procedure to create the required data
    • Alter an external configuration file (which could be password protected) which will indicate whether the stored procedure has already been run, could just be a simple bool
    • Each subsequent time the application runs it will check to see whether it’s run before and won’t execute the stored proc if it has

    Plan 2

    • Create a SQL script which will create and insert all the required data for the application to work and place this in a stored procedure
    • Use an installer to deploy your application with a custom action to create the database, explained here
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a program working with a database I created using SQL Server Compact
I want to create a program, that will use SQL Server 2008 database. During
I created some Maintenance Plans in SQL Server 2008 without using the wizard (i.e.
I created a JApplet using Netbeans 6.5.1 that accesses a database. When the program
I have a standard sql server 2008 project which has been created using vs2010.
We have a WinForms project that requires SQL Server 2008 R2 Express. The application
I have a SQL Server 2008 database table with three varchar Columns - Col1,
I've written a program that converts a SQL Server table into a SQLite table.
I'm using VS2010 (C#) for a WinForm database program. I've created a dataset, myds,
Using Visual Studio 2008, I created a C++ Win32 project. To release the program,

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.