Friday, June 26, 2015

Replace String In File Folder ASPX Excel VBA

Sub ReplaceStringInFile()

Dim objFSO As Object
Dim objFil As Object
Dim objFil2 As Object
Dim StrFileName As String
Dim StrFolder As String
Dim SstrAll As String

Set objFSO = CreateObject("scripting.filesystemobject")
StrFolder = "c:\temp1\"
StrFileName = Dir(StrFolder & "*.aspx")

Do While StrFileName <> vbNullString
    Set objFil = objFSO.opentextfile(StrFolder & StrFileName)
    strAll = objFil.readall
    objFil.Close
    Set objFil2 = objFSO.createtextfile(StrFolder & StrFileName)
    objFil2.Write Replace(strAll, "Title", "xxxxxxxxxx")
    objFil2.Close
    StrFileName = Dir
Loop
End Sub

Wednesday, June 3, 2015

SqlDataSource Timeout issue C# asp.net

SqlDataSource Timeout issue


 <asp:SqlDataSource ID="SqlDataSource1" runat="server" onselecting="dsTest_Selecting"
        ConnectionString="<%$ ConnectionStrings:BUDGETReports %>"
        ></asp:SqlDataSource>




Code behind


 protected void dsTest_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {
        e.Command.CommandTimeout = 1000;
    }