Skip to content

Host mongodb in Cloud for free

There are several hosting provider capable of host mongodb database. I like and is very nice ,free and Fully managed. It give 500MB Space for free. Web-based admin tools. […]

Overload Webservice.

TO workout the error when we overload the [WebMethod] like the following you must change webservice code as follows However, we may also get errors if which is the auto […]

Use Session Enabled Webservice in WindowsForm.

public class MyService : System.Web.Services.WebService { [WebMethod(EnableSession=true)] public void setMethod(bool value) { Session[“myBoolVariable”] = value; } [WebMethod(EnableSession=true)] public bool getMethod() { return (bool)Session[“myBoolVariable”]; } }   In above Webservice Session […]

Using Background worker in c#

private void InitTimer3() { tmrBack = new System.Windows.Forms.Timer(); tmrBack.Tick += new EventHandler(tmrBack_Tick); tmrBack.Interval = 1000; // in miliseconds tmrBack.Start(); } private void tmrBack_Tick(object sender, EventArgs e) { BackgroundWorker bw2 = […]

Checking website is online or offline in c#

public bool WebSiteIsAvailable(string Url) { string Message = string.Empty; HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(Url); // Set the credentials to the current user account request.Credentials = System.Net.CredentialCache.DefaultCredentials; request.Method = “GET”; try { […]

MS SQL server Function to read response from Http

CREATE FUNCTION [dbo].[GetHttp] (@url VARCHAR(8000)) RETURNS VARCHAR(8000) AS BEGIN DECLARE @win INT DECLARE @hr INT DECLARE @text VARCHAR(8000) EXEC @hr = sp_OACreate ‘WinHttp.WinHttpRequest.5.1’ ,@win OUT IF @hr 0 EXEC sp_OAGetErrorInfo […]