Help On Flag Variable

Posted by Vijayar under C# on 8/20/2011 | Points: 10 | Views : 2277 | Status : [Member] | Replies : 3
Hi
i have 3 forms and a single table,i need to insert data into a single table in database by making use of flag variable,how to do this ,please help me in doing this with an example for insertion of data

vijaya


Responses

Posted by: Jpchoudhari on: 8/22/2011 [Member] Starter | Points: 25

Up
0
Down
i am not clear on this... you want to use flag variable???

Kind Regards,
Jay

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vijayar on: 8/22/2011 [Member] Starter | Points: 25

Up
0
Down
I need to insert 3 forms data into a single table not maintaining separate tables.how to do that

vijaya

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jpchoudhari on: 8/22/2011 [Member] Starter | Points: 25

Up
0
Down
you can use this

Go to Project -> Add Class. Name your class Variables. Here is an example:

using System;

using System.Collections.Generic;
using System.Text;

namespace YourNamespaceName
{
public class Variables
{
public static string Name { get; set; }
public static string Address { get; set; }
}
}

Now you can set and access these properties in any of your windows forms and can save it to database.
Access it like Variables.Name="jay"

You can also use setting application settings
=>right-click on the project => select the settings tab and add values to it.

To access this values, call:

string value = WindowsApplication1.Properties.Settings.Default.Setting1;
Setting the values:

WindowsApplication1.Properties.Settings.Default.Setting1 = "newValue";

WindowsApplication1.Properties.Settings.Default.Save();


OR else you can use Singleton class
http://msdn.microsoft.com/en-us/library/ms998558


Kind Regards,
Jay

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response