string PathSelection = ""; if (PathSelection.Length > 0) { txtInputfile.Text = PathSelection; } // i tried this SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.InitialDirectory = saveFileDialog1.FileName; saveFileDialog1.Title = "Save Resource Files"; saveFileDialog1.CheckFileExists = true; saveFileDialog1.CheckPathExists = true; saveFileDialog1.DefaultExt = "resx"; saveFileDialog1.Filter = "Save Resource Files (*.resx)|*.resx"; saveFileDialog1.FilterIndex = 1; saveFileDialog1.RestoreDirectory = true; if (saveFileDialog1.ShowDialog() == DialogResult.OK) // error here! { PathSelection = saveFileDialog1.FileName; //string path = saveFileDialog1.FileName; oDataSet.WriteXml(PathSelection); } oDataSet.Tables.Add("Data");
string PathSelection = ""; // You have not initialized PathSelection, why shall its length > 0? //if (PathSelection.Length > 0) { //txtInputfile.Text = PathSelection; } // i tried this SaveFileDialog saveFileDialog1 = new SaveFileDialog(); // FileName has not been initialized! //saveFileDialog1.InitialDirectory = saveFileDialog1.FileName;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)