3 Replies - 1233 Views - Last Post: 08 April 2011 - 03:19 PM

#1 tsotne1990  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 230
  • Joined: 01-November 10

Using SQL to save windows form application.

Posted 03 April 2011 - 06:00 AM

Hello everybody! I am new to SQL and don't know how to store the windows form application made in C# VS 2010 into SQL database in order to be able to reclaim that form once needed. Can anyone briefly describe the steps or give a general direction to follow? I haven't installed SQL yet, only VS 2010, will it be enough? Or I need to install SQL independently? If yes please point a link of a program and I'll download and install. Thank you very much.

Is This A Good Question/Topic? 0
  • +

Replies To: Using SQL to save windows form application.

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4333
  • View blog
  • Posts: 12,128
  • Joined: 18-April 07

Re: Using SQL to save windows form application.

Posted 03 April 2011 - 09:38 AM

Well you don't store the form itself, you store the data that you use to populate the form. How you store that in the database (in case you even need to) depends on the data itself.

Lets assume I have a form which is a login form for my application. It has a username, password and a checkbox to remember my password. In the database I would store the username, password and a boolean (true/false) on whether or not I am remembering my password or not.

When I start up the application and type in my username (or in case I want to remember that too) I make a call out to the database to find the user's record, pull all three fields using a SQL select statement and then set the username textbox to the user name value, the password textbox to the password value and if the remember password is true you check the checkbox.

So when you create a new form think about the values it will need to populate the various controls and those are the fields which will be in the database.

As for installing SQL, yes, you have to install SQL separately. It can be a full version of SQL (you pay for), it could be the free express edition or it can even be the free compact edition if you want just a small database to keep track of a small application's data.

Also I want to mention that you can store application information in the application settings section or a local file depending on the type of security requirements you need.

Hope this helped. :)
Was This Post Helpful? 3
  • +
  • -

#3 tsotne1990  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 230
  • Joined: 01-November 10

Re: Using SQL to save windows form application.

Posted 03 April 2011 - 11:06 AM

Thank you very much for such an excellent explanation. I really appreciate it. One more question please. You are correct, I have a grid and vectors stored in that grid and I want to save that grid component in SQL. I will manage it myself. Please could you point a link where to download a full SQL(paid one). Thanks a lot again
Was This Post Helpful? -1
  • +
  • -

#4 CodeGrappler  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 120
  • Joined: 29-November 10

Re: Using SQL to save windows form application.

Posted 08 April 2011 - 03:19 PM

View Posttsotne1990, on 03 April 2011 - 11:06 AM, said:

Thank you very much for such an excellent explanation. I really appreciate it. One more question please. You are correct, I have a grid and vectors stored in that grid and I want to save that grid component in SQL. I will manage it myself. Please could you point a link where to download a full SQL(paid one). Thanks a lot again


You buy it from microsoft. Pirating is not tolerated here.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1