Tuesday, December 5, 2023

The remote server returned an error: (411) Length Required

When we make a HttpWebRequest using method POST, we must specify the length of data sending.

 

string data = "Test data to be sent";
byte[] postData = Encoding.ASCII.GetBytes(data);
webRequest.ContentLength = postData.Length;



If we wish not to send any data, just set it to 0.. 


webRequest.ContentLength = 0;



Note: If we are not sending any data, we should use the GET method.



Monday, November 27, 2023

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

 

 

Above error occurs when The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine or server where application is deployed. 

For resolving this issue, it requires to install 

Microsoft Access Database Engine 2010 Redistributable.  

Click here to download the file.