0

I have developed c# application which is not having any database.I have saved the application with data in rich textboxes in my custom file format.When i click on the saved application,I can open my application but,i was unable to open with the data saved in it.
How to load the saved data in my application.
I was unable to load data when application starts.

When i click on the save button my application is saved in my file format(.edp),it is saved on my desktop.When i double click on saved file icon my application is opening in my file format with my UI design,but not he data in it.

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by nick.crane
0

When i double click on saved file icon my application is opening in my file format with my UI design,but not he data in it.

Does this mean clicking on the file in file explorere?
If so, then you need to make your application main method handle incoming parameters.
Something like this might work.

static class Program
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			if (args!=null && !string.IsNullOrWhiteSpace(args[0]))
				Application.Run(new Form1(args));
			else
				Application.Run(new Form1());
		}
	}

Note: You will also need to create a constructor for your main form that takes and uses the incoming parameter (usually the filename of the file clicked).

0

I have a problem at "app.SelectedFile" . I am getting this error,does not contain a definition for "selected File" and no extension method selected file accepting a first argument of type could not be found.

0

Please show the code you are having problems with and indicate where the error is showing.
Then it will be easier to figure out how to help you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.