Posts

Showing posts from August, 2019

Donate

SQL Server : Login Success But “The database [dbName] is not accessible.” After Domain Migration Using New Domain User

Image
Recently, our systems administrator has just finished migrating our workstations from an old domain to a new domain. But this caused an issue wherein most of the databases are not accessible. I've done several workarounds from stackoverflow and non of them worked. The solution that worked is to add my new domain user to the databases using SQL Server Authentication (sa) and set my new domain user as dbOwner.

How Get Total Number Of Rows From SQLDataReader Object Using C#

Good Evening Gents! In the office, we were using SQLDataReader class to read from SQL Server database in a straight-forward manner. The SQLDataReader has several properties that are commonly used such as HasRows and FieldCount. However in one of my task, I want to retrieve the total number of rows returned from the SQLDataReader object and there's no such property that support this. Doing some search led me to this link How to get number of rows using SqlDataReader in C# . The one that worked for me was the answer using select @@ROWCOUNT query. I modified his answer by writing my own method that will accept a List of SQLParameters given that the original query requires parameters. private static void GetTotalRowCount( string query, string connectionString, ref int totalRows, List<SqlParameter> sqlParameters) { try { using ( var sqlCon = new SqlConnection(connectionString)) { sqlCon.Open(); var cmd = sqlCon.CreateCommand(); cmd.CommandText = q...

This Site Can’t Provide a Secure Connection Localhost Sent An Invalid Response In ASP Classic Website

Good afternoon fellow programmers! In the event that you added an ASP Classic site to Visual Studio and when you debug or run the site, it produced an error such as "This site can’t provide a secure connection localhost sent an invalid response. Try running Windows Network Diagnostics. ERR_SSL_PROTOCOL_ERROR". The fix to this error is to comment or remove the rewrite rule in web.config. A sample rewrite node looks like this in web.config. <?xml version="1.0"?> <configuration> <system.webServer> <!--<rewrite> <rules> <rule name="Redirect to HTTPs" stopProcessing="true"> <match url="(.*)"/> <conditions> <add input="{HTTPS}" pattern="^OFF$"/> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther"/> ...

Response Buffer Limit Exceeded. Execution of the ASP Page Caused The Response Buffer To Exceed Its Configured Limit

Good evening fellow developers! I've been given a project to rewrite an existing ASP Classic Website written in VBScript to ASP.NET MVC. For now, I'm on research stage and familiarization of the existing modules and page functionalities. The site is fully functional but some of the pages rendered an error called "Response Buffer Limit Exceeded". After doing some google search, the solution that worked for me is to set the Response Buffer of the page to false right after Language declaration. <%@ LANGUAGE = "VBSCRIPT" %> <% Response.Buffer = False %> Reference: Response Buffer Limit Exceeded Cheers! :)

Visual Studio And WPF Menu Items Are Left Aligned Instead Of Right Aligned

Image
Hello, We noticed lately that our WPF Projects menu items and Visual Studio menu items are left aligned rather than right aligned. However, not all desktop were affected by this issue. Further research led me here Windows 10 Drop-Down Menus Are Aligned To The Left in which you have to execute a shell command shell:::{80F3F1D5-FECA-45F3-BC32-752C152E456E} via Windows + R command. This will open the Tablet PC Settings with Right-Handed radio button checked. Changing it to Left-Handed then Apply will change the menu items alignment to the right. Visual Studio Menu Items Are Now Right Aligned

Donate