Hi,

  Try changing the file name might also work but I am putting the code like 
below. I debugged it and seems like working. But I couldn't simulate a 
scenario while the file is being written but I am assuming it should work. 
Please take a look at it.

protected void BindData()
        {
            try
            {
                DataView dvGridData;
                AXGridView.PageIndexChanging += new
                       GridViewPageEventHandler(AXGridView_PageIndexChanging);
                AXGridView.PagerTemplate = null;
                DataSet dsGridData = new DataSet();
                
                //start of new code
                
                while (IsFileLocked(dsGridData))
                {
                    System.Threading.Thread.Sleep(500);
                }
               //end of new code

                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;
            }
        }
protected Boolean IsFileLocked(DataSet dsGridData)
        {
            try
            {
               dsGridData.ReadXml(Server.MapPath(FilePath));
            }
            catch (IOException)
            {
                return true;
            }
            //file is not locked
            return false;
        }

Please provide if you have any comments on this.

Thanks,

Dev
On Wednesday, October 30, 2013 5:02:54 PM UTC-4, srussell705 wrote:
>
>
>
>
> On Wed, Oct 30, 2013 at 3:46 PM, Learner <[email protected] 
> <javascript:>>wrote:
>
>> Thanks for the quick reply. But not sure if I understand what you meant. 
>> Can you please elobarate or a code snippet helps..
>>
>>
> ----------------------
>
> http://lmgtfy.com/?q=C%23+change+a+filename
>
>
> -- 
> 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.

Reply via email to