I would attempt to change the file name as my test for write completed.
On Wed, Oct 30, 2013 at 3:16 PM, Learner <[email protected]> wrote: > Hi, > > The dataset in my application reads an xml from the network and uses that > as a datasource to load the data. This XML file is generated every 15 mins > (15 mins old data to the live). Users search against this xml file and I > want to make sure that the xml file is ready and not still being written > the to the network folder. If it still writing then I would like to put the > thread to sleep for couple of seconds and try reading the file again. Here > is what I currently have and this needs modification. > > protected void BindData() > > { > > try > > { > > DataView dvGridData; > > AXGridView.PageIndexChanging += new GridViewPageEventHandler(** > AXGridView_PageIndexChanging); > > AXGridView.PagerTemplate = null; > > DataSet dsGridData = new DataSet(); > > dsGridData.ReadXml(Server.**MapPath(FilePath)); //This is how I > am reading XML file. This is where I need to test if it is written > completely and if not need to wait for couple of seconds or until it is > fully written. > > if (dsGridData.Tables.Count > 0) > > dvGridData = new DataView(dsGridData.Tables[0])**; > > else > > dvGridData = new DataView(); > > dvGridData.RowFilter = FilterExpression; > > AXGridView.DataSource = dvGridData; > > AXGridView.DataBind(); > > } > > catch > > { > > throw; > > } > > } > > > Thanks for the any help or code. > > > Thanks, > > > Dev > > -- > -- > You received this message because you are subscribed to the Google > Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML > Web Services,.NET Remoting" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en > or visit the group website at http://megasolutions.net > > --- > You received this message because you are subscribed to the Google Groups > "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web > Services,.NET Remoting" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- Stephen Russell Sr. Analyst Ring Container Technology Oakland TN 901.246-0159 cell -- -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net --- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
